diff --git a/src/bgp/path_attributes.rs b/src/bgp/path_attributes.rs index 40fd3a1d..386fe830 100644 --- a/src/bgp/path_attributes.rs +++ b/src/bgp/path_attributes.rs @@ -341,15 +341,21 @@ impl PaMap { pub trait FromAttribute { - fn from_attribute(value: PathAttribute) -> Option + fn from_attribute(_value: PathAttribute) -> Option where - Self: Sized; - fn attribute_type() -> Option; + Self: Sized { + None + } + + fn attribute_type() -> Option { + None + } + } impl From for PaMap { - fn from(value: AttributesMap) -> Self { - Self { attributes: value } + fn from(attributes: AttributesMap) -> Self { + Self { attributes } } } diff --git a/src/bgp/workshop/route.rs b/src/bgp/workshop/route.rs index 038b55c7..5dcb0ac3 100644 --- a/src/bgp/workshop/route.rs +++ b/src/bgp/workshop/route.rs @@ -13,7 +13,7 @@ use crate::bgp::{ message::{nlri::Nlri, update_builder::StandardCommunitiesList}, path_attributes::{ ExtendedCommunitiesList, Ipv6ExtendedCommunitiesList, - LargeCommunitiesList, PathAttribute, PathAttributeType, + LargeCommunitiesList, PathAttribute, }, }; @@ -241,29 +241,11 @@ impl WorkshopAttribute for Vec { } } -impl FromAttribute for Vec { - fn from_attribute(_value: PathAttribute) -> Option { - None - } - - fn attribute_type() -> Option { - None - } -} +impl FromAttribute for Vec { } //------------ NlriWorkshop -------------------------------------------------- -impl FromAttribute for crate::bgp::message::nlri::Nlri> { - fn from_attribute(_value: PathAttribute) -> Option - where - Self: Sized { - None - } - - fn attribute_type() -> Option { - None - } -} +impl FromAttribute for crate::bgp::message::nlri::Nlri> { } impl WorkshopAttribute for crate::bgp::message::nlri::Nlri> { fn retrieve(attrs: &PaMap) -> Option @@ -286,15 +268,7 @@ impl WorkshopAttribute for crate::bgp::message::nlri::Nlri Option { - None - } - - fn from_attribute(_value: PathAttribute) -> Option { - None - } -} +impl FromAttribute for crate::bgp::types::NextHop { } impl WorkshopAttribute for crate::bgp::types::NextHop { fn retrieve(attrs: &PaMap) -> Option {