Skip to content

netkit: use Display/FromStr from netlink-packet-route#35

Merged
cathay4t merged 1 commit into
rust-netlink:mainfrom
cathay4t:main
Jun 11, 2026
Merged

netkit: use Display/FromStr from netlink-packet-route#35
cathay4t merged 1 commit into
rust-netlink:mainfrom
cathay4t:main

Conversation

@cathay4t

@cathay4t cathay4t commented Jun 11, 2026

Copy link
Copy Markdown
Member

Replace manual match blocks for enum-to-string and string-to-enum
conversions with the Display and FromStr implementations now
provided by netlink-packet-route for NetkitMode, NetkitPolicy,
and NetkitScrub.

Replace manual match blocks for enum-to-string and string-to-enum
conversions with the `Display` and `FromStr` implementations now
provided by `netlink-packet-route` for `NetkitMode`, `NetkitPolicy`,
and `NetkitScrub`.

Signed-off-by: Gris Ge <cnfourt@gmail.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the netkit interface implementation in src/ip/link/ifaces/netkit.rs by replacing manual match statements with .to_string() and .parse() calls for netkit modes, policies, and scrub settings. Feedback on the changes suggests using .expect() instead of returning a user-facing error when parsing the netkit policy, as the input key is already pre-validated by a match pattern, making a parsing failure statically unreachable.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/ip/link/ifaces/netkit.rs
@cathay4t
cathay4t enabled auto-merge (rebase) June 11, 2026 05:46
@cathay4t
cathay4t merged commit 7ed0177 into rust-netlink:main Jun 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant