@@ -233,10 +233,8 @@ impl<'a> arbitrary::Arbitrary<'a> for FamilyAndLen {
233
233
/// - Other than that, prefixes are sorted numerically from low to high
234
234
///
235
235
/// The rationale behind this ordering is that in most use cases processing a
236
- /// more-specific before any less-specific is more efficient (i.e. longest
237
- /// prefix matching in routing/forwarding)) or preventing unwanted
238
- /// intermediate stage (i.e. ROAs/VRPs for less-specifics making
239
- /// not-yet-processed more-specifics Invalid).
236
+ /// more-specific before any less-specific is more efficient or preventing
237
+ /// unwanted intermediate stage when evaluating prefixes in order.
240
238
#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
241
239
pub struct Prefix {
242
240
/// The address family and prefix length all in one.
@@ -447,26 +445,6 @@ impl Ord for Prefix {
447
445
}
448
446
}
449
447
450
- //--- From
451
-
452
- #[ cfg( feature = "repository" ) ]
453
- impl From < crate :: repository:: roa:: FriendlyRoaIpAddress > for Prefix {
454
- fn from ( addr : crate :: repository:: roa:: FriendlyRoaIpAddress ) -> Self {
455
- Prefix :: new (
456
- addr. address ( ) , addr. address_length ( )
457
- ) . expect ( "ROA IP address with illegal prefix length" )
458
- }
459
- }
460
-
461
- #[ cfg( feature = "repository" ) ]
462
- impl From < Prefix > for crate :: repository:: resources:: IpBlock {
463
- fn from ( src : Prefix ) -> Self {
464
- crate :: repository:: resources:: Prefix :: new (
465
- src. addr ( ) , src. len ( )
466
- ) . into ( )
467
- }
468
- }
469
-
470
448
471
449
//--- Deserialize and Serialize
472
450
@@ -560,18 +538,20 @@ impl<'a> arbitrary::Arbitrary<'a> for Prefix {
560
538
/// The pair of a prefix and an optional max-len.
561
539
///
562
540
/// # Ordering
541
+ ///
563
542
/// The ordering of MaxLenPrefixes is similar to the [ordering of
564
543
/// Prefixes](Prefix#Ordering). The only difference is the optional MaxLen.
565
544
/// When two prefixes are equal but differ in (presence of) max_len, the order
566
545
/// is as follows:
567
- /// - any max_len always comes before no max_len
568
- /// - a larger (higher) max_len comes before a smaller (lower) max_len (e.g.
569
- /// 24 comes before 20). This is analog to how more-specifics come before
570
- /// less-specifics.
546
+ ///
547
+ /// * any max_len always comes before no max_len
548
+ /// * a larger (higher) max_len comes before a smaller (lower) max_len (e.g.
549
+ /// 24 comes before 20). This is analog to how more-specifics come before
550
+ /// less-specifics.
571
551
///
572
552
/// Note that the max_len can either be equal to the prefix length (with no
573
553
/// practical difference from an omitted max_len) or larger than the prefix
574
- /// length. The max_len can not be smaller than the prefix length. Because of
554
+ /// length. The max_len cannot be smaller than the prefix length. Because of
575
555
/// that, we can safely order 'any max_len' before 'no max_len' for equal
576
556
/// prefixes.
577
557
#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
0 commit comments