@@ -98,7 +98,9 @@ impl Emitable for RouteHeader {
9898
9999#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
100100#[ non_exhaustive]
101+ #[ derive( Default ) ]
101102pub enum RouteProtocol {
103+ #[ default]
102104 Unspec ,
103105 IcmpRedirect ,
104106 Kernel ,
@@ -237,12 +239,6 @@ impl std::fmt::Display for RouteProtocol {
237239 }
238240}
239241
240- impl Default for RouteProtocol {
241- fn default ( ) -> Self {
242- Self :: Unspec
243- }
244- }
245-
246242impl Parseable < [ u8 ] > for RouteProtocol {
247243 fn parse ( buf : & [ u8 ] ) -> Result < Self , DecodeError > {
248244 if buf. len ( ) == 1 {
@@ -273,7 +269,9 @@ const RT_SCOPE_NOWHERE: u8 = 255;
273269
274270#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
275271#[ non_exhaustive]
272+ #[ derive( Default ) ]
276273pub enum RouteScope {
274+ #[ default]
277275 Universe ,
278276 Site ,
279277 Link ,
@@ -308,12 +306,6 @@ impl From<u8> for RouteScope {
308306 }
309307}
310308
311- impl Default for RouteScope {
312- fn default ( ) -> Self {
313- Self :: Universe
314- }
315- }
316-
317309impl std:: fmt:: Display for RouteScope {
318310 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
319311 match self {
@@ -329,8 +321,10 @@ impl std::fmt::Display for RouteScope {
329321
330322#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
331323#[ non_exhaustive]
324+ #[ derive( Default ) ]
332325pub enum RouteType {
333326 /// Unknown
327+ #[ default]
334328 Unspec ,
335329 /// Gateway or direct route
336330 Unicast ,
@@ -390,12 +384,6 @@ impl From<u8> for RouteType {
390384 }
391385}
392386
393- impl Default for RouteType {
394- fn default ( ) -> Self {
395- Self :: Unspec
396- }
397- }
398-
399387impl From < RouteType > for u8 {
400388 fn from ( v : RouteType ) -> Self {
401389 match v {
0 commit comments