Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions src/route/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<Self, DecodeError> {
if buf.len() == 1 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -308,12 +306,6 @@ impl From<u8> 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 {
Expand All @@ -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,
Expand Down Expand Up @@ -390,12 +384,6 @@ impl From<u8> for RouteType {
}
}

impl Default for RouteType {
fn default() -> Self {
Self::Unspec
}
}

impl From<RouteType> for u8 {
fn from(v: RouteType) -> Self {
match v {
Expand Down
8 changes: 2 additions & 6 deletions src/route/preference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down Expand Up @@ -38,9 +40,3 @@ impl From<u8> for RoutePreference {
}
}
}

impl Default for RoutePreference {
fn default() -> Self {
Self::Invalid
}
}
Empty file modified src/tc/actions/tunnel_key.rs
100755 → 100644
Empty file.
Loading