netkit: use Display/FromStr from netlink-packet-route#35
Conversation
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>
There was a problem hiding this comment.
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.
Replace manual match blocks for enum-to-string and string-to-enum
conversions with the
DisplayandFromStrimplementations nowprovided by
netlink-packet-routeforNetkitMode,NetkitPolicy,and
NetkitScrub.