From 6b79cb0ed4afbabf77038ed5e2888545ca4c307d Mon Sep 17 00:00:00 2001 From: Gris Ge Date: Thu, 18 Sep 2025 16:38:42 +0800 Subject: [PATCH 1/2] Remove execution bit of `src/tc/actions/tunnel_key.rs` Signed-off-by: Gris Ge --- src/tc/actions/tunnel_key.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/tc/actions/tunnel_key.rs diff --git a/src/tc/actions/tunnel_key.rs b/src/tc/actions/tunnel_key.rs old mode 100755 new mode 100644 From bf0339b8e2a8e8e820edae2f28a64ace62a524dc Mon Sep 17 00:00:00 2001 From: Gris Ge Date: Thu, 18 Sep 2025 16:40:45 +0800 Subject: [PATCH 2/2] Run cargo clippy and cargo fmt Signed-off-by: Gris Ge --- src/route/header.rs | 24 ++++++------------------ src/route/preference.rs | 8 ++------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/route/header.rs b/src/route/header.rs index f19ef4bf..c3050cee 100644 --- a/src/route/header.rs +++ b/src/route/header.rs @@ -98,7 +98,9 @@ impl Emitable for RouteHeader { #[derive(Debug, PartialEq, Eq, Clone, Copy)] #[non_exhaustive] +#[derive(Default)] pub enum RouteProtocol { + #[default] Unspec, IcmpRedirect, Kernel, @@ -237,12 +239,6 @@ impl std::fmt::Display for RouteProtocol { } } -impl Default for RouteProtocol { - fn default() -> Self { - Self::Unspec - } -} - impl Parseable<[u8]> for RouteProtocol { fn parse(buf: &[u8]) -> Result { if buf.len() == 1 { @@ -273,7 +269,9 @@ const RT_SCOPE_NOWHERE: u8 = 255; #[derive(Debug, PartialEq, Eq, Clone, Copy)] #[non_exhaustive] +#[derive(Default)] pub enum RouteScope { + #[default] Universe, Site, Link, @@ -308,12 +306,6 @@ impl From for RouteScope { } } -impl Default for RouteScope { - fn default() -> Self { - Self::Universe - } -} - impl std::fmt::Display for RouteScope { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { @@ -329,8 +321,10 @@ impl std::fmt::Display for RouteScope { #[derive(Debug, PartialEq, Eq, Clone, Copy)] #[non_exhaustive] +#[derive(Default)] pub enum RouteType { /// Unknown + #[default] Unspec, /// Gateway or direct route Unicast, @@ -390,12 +384,6 @@ impl From for RouteType { } } -impl Default for RouteType { - fn default() -> Self { - Self::Unspec - } -} - impl From for u8 { fn from(v: RouteType) -> Self { match v { diff --git a/src/route/preference.rs b/src/route/preference.rs index a18dcc01..89efd019 100644 --- a/src/route/preference.rs +++ b/src/route/preference.rs @@ -7,10 +7,12 @@ const ICMPV6_ROUTER_PREF_INVALID: u8 = 0x2; #[derive(Debug, PartialEq, Eq, Clone, Copy)] #[non_exhaustive] +#[derive(Default)] pub enum RoutePreference { Low, Medium, High, + #[default] Invalid, Other(u8), } @@ -38,9 +40,3 @@ impl From for RoutePreference { } } } - -impl Default for RoutePreference { - fn default() -> Self { - Self::Invalid - } -}