@@ -100,15 +100,15 @@ impl PacketList {
100
100
101
101
/// Get the number of packets in the list.
102
102
///
103
- pub fn length ( & self ) -> usize {
103
+ pub fn len ( & self ) -> usize {
104
104
self . inner . num_packets as usize
105
105
}
106
106
107
107
/// Get an iterator for the packets in the list.
108
108
///
109
109
pub fn iter < ' a > ( & ' a self ) -> PacketListIterator < ' a > {
110
110
PacketListIterator {
111
- count : self . length ( ) ,
111
+ count : self . len ( ) ,
112
112
packet_ptr : self . inner . data . as_ptr ( ) ,
113
113
_phantom : :: std:: marker:: PhantomData :: default ( ) ,
114
114
}
@@ -447,7 +447,7 @@ mod tests {
447
447
packet_buf. push_packet ( 43 , & [ 0x91u8 , 0x40 , 0x7f ] ) ;
448
448
packet_buf. push_packet ( 44 , & [ 0x80u8 , 0x40 , 0x7f ] ) ;
449
449
packet_buf. push_packet ( 45 , & [ 0x81u8 , 0x40 , 0x7f ] ) ;
450
- assert_eq ! ( packet_buf. length ( ) , 4 ) ;
450
+ assert_eq ! ( packet_buf. len ( ) , 4 ) ;
451
451
}
452
452
453
453
#[ test]
@@ -560,7 +560,7 @@ mod tests {
560
560
let list: & PacketList = & packet_buf;
561
561
562
562
// check if the contents match
563
- assert_eq ! ( list_native. length ( ) , list. length ( ) , "PacketList lenghts must match" ) ;
563
+ assert_eq ! ( list_native. len ( ) , list. len ( ) , "PacketList lengths must match" ) ;
564
564
for ( n, p) in list_native. iter ( ) . zip ( list. iter ( ) ) {
565
565
assert_eq ! ( n. data( ) , p. data( ) ) ;
566
566
}
0 commit comments