@@ -98,7 +98,9 @@ impl Emitable for RouteHeader {
98
98
99
99
#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
100
100
#[ non_exhaustive]
101
+ #[ derive( Default ) ]
101
102
pub enum RouteProtocol {
103
+ #[ default]
102
104
Unspec ,
103
105
IcmpRedirect ,
104
106
Kernel ,
@@ -237,12 +239,6 @@ impl std::fmt::Display for RouteProtocol {
237
239
}
238
240
}
239
241
240
- impl Default for RouteProtocol {
241
- fn default ( ) -> Self {
242
- Self :: Unspec
243
- }
244
- }
245
-
246
242
impl Parseable < [ u8 ] > for RouteProtocol {
247
243
fn parse ( buf : & [ u8 ] ) -> Result < Self , DecodeError > {
248
244
if buf. len ( ) == 1 {
@@ -273,7 +269,9 @@ const RT_SCOPE_NOWHERE: u8 = 255;
273
269
274
270
#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
275
271
#[ non_exhaustive]
272
+ #[ derive( Default ) ]
276
273
pub enum RouteScope {
274
+ #[ default]
277
275
Universe ,
278
276
Site ,
279
277
Link ,
@@ -308,12 +306,6 @@ impl From<u8> for RouteScope {
308
306
}
309
307
}
310
308
311
- impl Default for RouteScope {
312
- fn default ( ) -> Self {
313
- Self :: Universe
314
- }
315
- }
316
-
317
309
impl std:: fmt:: Display for RouteScope {
318
310
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
319
311
match self {
@@ -329,8 +321,10 @@ impl std::fmt::Display for RouteScope {
329
321
330
322
#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
331
323
#[ non_exhaustive]
324
+ #[ derive( Default ) ]
332
325
pub enum RouteType {
333
326
/// Unknown
327
+ #[ default]
334
328
Unspec ,
335
329
/// Gateway or direct route
336
330
Unicast ,
@@ -390,12 +384,6 @@ impl From<u8> for RouteType {
390
384
}
391
385
}
392
386
393
- impl Default for RouteType {
394
- fn default ( ) -> Self {
395
- Self :: Unspec
396
- }
397
- }
398
-
399
387
impl From < RouteType > for u8 {
400
388
fn from ( v : RouteType ) -> Self {
401
389
match v {
0 commit comments