@@ -23,12 +23,12 @@ macro_rules! buf_get_impl {
23
23
if let Some ( ret) = ret {
24
24
// if the direct conversion was possible, advance and return
25
25
$this. advance( SIZE ) ;
26
- return ret;
26
+ ret
27
27
} else {
28
28
// if not we copy the bytes in a temp buffer then convert
29
29
let mut buf = [ 0 ; SIZE ] ;
30
30
$this. copy_to_slice( & mut buf) ; // (do the advance)
31
- return $typ:: $conv( buf) ;
31
+ $typ:: $conv( buf)
32
32
}
33
33
} } ;
34
34
( le => $this: ident, $typ: tt, $len_to_read: expr) => { {
@@ -332,7 +332,7 @@ pub trait Buf {
332
332
///
333
333
/// This function panics if there is not enough remaining data in `self`.
334
334
fn get_u16 ( & mut self ) -> u16 {
335
- buf_get_impl ! ( self , u16 :: from_be_bytes) ;
335
+ buf_get_impl ! ( self , u16 :: from_be_bytes)
336
336
}
337
337
338
338
/// Gets an unsigned 16 bit integer from `self` in little-endian byte order.
@@ -352,7 +352,7 @@ pub trait Buf {
352
352
///
353
353
/// This function panics if there is not enough remaining data in `self`.
354
354
fn get_u16_le ( & mut self ) -> u16 {
355
- buf_get_impl ! ( self , u16 :: from_le_bytes) ;
355
+ buf_get_impl ! ( self , u16 :: from_le_bytes)
356
356
}
357
357
358
358
/// Gets an unsigned 16 bit integer from `self` in native-endian byte order.
@@ -375,7 +375,7 @@ pub trait Buf {
375
375
///
376
376
/// This function panics if there is not enough remaining data in `self`.
377
377
fn get_u16_ne ( & mut self ) -> u16 {
378
- buf_get_impl ! ( self , u16 :: from_ne_bytes) ;
378
+ buf_get_impl ! ( self , u16 :: from_ne_bytes)
379
379
}
380
380
381
381
/// Gets a signed 16 bit integer from `self` in big-endian byte order.
@@ -395,7 +395,7 @@ pub trait Buf {
395
395
///
396
396
/// This function panics if there is not enough remaining data in `self`.
397
397
fn get_i16 ( & mut self ) -> i16 {
398
- buf_get_impl ! ( self , i16 :: from_be_bytes) ;
398
+ buf_get_impl ! ( self , i16 :: from_be_bytes)
399
399
}
400
400
401
401
/// Gets a signed 16 bit integer from `self` in little-endian byte order.
@@ -415,7 +415,7 @@ pub trait Buf {
415
415
///
416
416
/// This function panics if there is not enough remaining data in `self`.
417
417
fn get_i16_le ( & mut self ) -> i16 {
418
- buf_get_impl ! ( self , i16 :: from_le_bytes) ;
418
+ buf_get_impl ! ( self , i16 :: from_le_bytes)
419
419
}
420
420
421
421
/// Gets a signed 16 bit integer from `self` in native-endian byte order.
@@ -438,7 +438,7 @@ pub trait Buf {
438
438
///
439
439
/// This function panics if there is not enough remaining data in `self`.
440
440
fn get_i16_ne ( & mut self ) -> i16 {
441
- buf_get_impl ! ( self , i16 :: from_ne_bytes) ;
441
+ buf_get_impl ! ( self , i16 :: from_ne_bytes)
442
442
}
443
443
444
444
/// Gets an unsigned 32 bit integer from `self` in the big-endian byte order.
@@ -458,7 +458,7 @@ pub trait Buf {
458
458
///
459
459
/// This function panics if there is not enough remaining data in `self`.
460
460
fn get_u32 ( & mut self ) -> u32 {
461
- buf_get_impl ! ( self , u32 :: from_be_bytes) ;
461
+ buf_get_impl ! ( self , u32 :: from_be_bytes)
462
462
}
463
463
464
464
/// Gets an unsigned 32 bit integer from `self` in the little-endian byte order.
@@ -478,7 +478,7 @@ pub trait Buf {
478
478
///
479
479
/// This function panics if there is not enough remaining data in `self`.
480
480
fn get_u32_le ( & mut self ) -> u32 {
481
- buf_get_impl ! ( self , u32 :: from_le_bytes) ;
481
+ buf_get_impl ! ( self , u32 :: from_le_bytes)
482
482
}
483
483
484
484
/// Gets an unsigned 32 bit integer from `self` in native-endian byte order.
@@ -501,7 +501,7 @@ pub trait Buf {
501
501
///
502
502
/// This function panics if there is not enough remaining data in `self`.
503
503
fn get_u32_ne ( & mut self ) -> u32 {
504
- buf_get_impl ! ( self , u32 :: from_ne_bytes) ;
504
+ buf_get_impl ! ( self , u32 :: from_ne_bytes)
505
505
}
506
506
507
507
/// Gets a signed 32 bit integer from `self` in big-endian byte order.
@@ -521,7 +521,7 @@ pub trait Buf {
521
521
///
522
522
/// This function panics if there is not enough remaining data in `self`.
523
523
fn get_i32 ( & mut self ) -> i32 {
524
- buf_get_impl ! ( self , i32 :: from_be_bytes) ;
524
+ buf_get_impl ! ( self , i32 :: from_be_bytes)
525
525
}
526
526
527
527
/// Gets a signed 32 bit integer from `self` in little-endian byte order.
@@ -541,7 +541,7 @@ pub trait Buf {
541
541
///
542
542
/// This function panics if there is not enough remaining data in `self`.
543
543
fn get_i32_le ( & mut self ) -> i32 {
544
- buf_get_impl ! ( self , i32 :: from_le_bytes) ;
544
+ buf_get_impl ! ( self , i32 :: from_le_bytes)
545
545
}
546
546
547
547
/// Gets a signed 32 bit integer from `self` in native-endian byte order.
@@ -564,7 +564,7 @@ pub trait Buf {
564
564
///
565
565
/// This function panics if there is not enough remaining data in `self`.
566
566
fn get_i32_ne ( & mut self ) -> i32 {
567
- buf_get_impl ! ( self , i32 :: from_ne_bytes) ;
567
+ buf_get_impl ! ( self , i32 :: from_ne_bytes)
568
568
}
569
569
570
570
/// Gets an unsigned 64 bit integer from `self` in big-endian byte order.
@@ -584,7 +584,7 @@ pub trait Buf {
584
584
///
585
585
/// This function panics if there is not enough remaining data in `self`.
586
586
fn get_u64 ( & mut self ) -> u64 {
587
- buf_get_impl ! ( self , u64 :: from_be_bytes) ;
587
+ buf_get_impl ! ( self , u64 :: from_be_bytes)
588
588
}
589
589
590
590
/// Gets an unsigned 64 bit integer from `self` in little-endian byte order.
@@ -604,7 +604,7 @@ pub trait Buf {
604
604
///
605
605
/// This function panics if there is not enough remaining data in `self`.
606
606
fn get_u64_le ( & mut self ) -> u64 {
607
- buf_get_impl ! ( self , u64 :: from_le_bytes) ;
607
+ buf_get_impl ! ( self , u64 :: from_le_bytes)
608
608
}
609
609
610
610
/// Gets an unsigned 64 bit integer from `self` in native-endian byte order.
@@ -627,7 +627,7 @@ pub trait Buf {
627
627
///
628
628
/// This function panics if there is not enough remaining data in `self`.
629
629
fn get_u64_ne ( & mut self ) -> u64 {
630
- buf_get_impl ! ( self , u64 :: from_ne_bytes) ;
630
+ buf_get_impl ! ( self , u64 :: from_ne_bytes)
631
631
}
632
632
633
633
/// Gets a signed 64 bit integer from `self` in big-endian byte order.
@@ -647,7 +647,7 @@ pub trait Buf {
647
647
///
648
648
/// This function panics if there is not enough remaining data in `self`.
649
649
fn get_i64 ( & mut self ) -> i64 {
650
- buf_get_impl ! ( self , i64 :: from_be_bytes) ;
650
+ buf_get_impl ! ( self , i64 :: from_be_bytes)
651
651
}
652
652
653
653
/// Gets a signed 64 bit integer from `self` in little-endian byte order.
@@ -667,7 +667,7 @@ pub trait Buf {
667
667
///
668
668
/// This function panics if there is not enough remaining data in `self`.
669
669
fn get_i64_le ( & mut self ) -> i64 {
670
- buf_get_impl ! ( self , i64 :: from_le_bytes) ;
670
+ buf_get_impl ! ( self , i64 :: from_le_bytes)
671
671
}
672
672
673
673
/// Gets a signed 64 bit integer from `self` in native-endian byte order.
@@ -690,7 +690,7 @@ pub trait Buf {
690
690
///
691
691
/// This function panics if there is not enough remaining data in `self`.
692
692
fn get_i64_ne ( & mut self ) -> i64 {
693
- buf_get_impl ! ( self , i64 :: from_ne_bytes) ;
693
+ buf_get_impl ! ( self , i64 :: from_ne_bytes)
694
694
}
695
695
696
696
/// Gets an unsigned 128 bit integer from `self` in big-endian byte order.
@@ -710,7 +710,7 @@ pub trait Buf {
710
710
///
711
711
/// This function panics if there is not enough remaining data in `self`.
712
712
fn get_u128 ( & mut self ) -> u128 {
713
- buf_get_impl ! ( self , u128 :: from_be_bytes) ;
713
+ buf_get_impl ! ( self , u128 :: from_be_bytes)
714
714
}
715
715
716
716
/// Gets an unsigned 128 bit integer from `self` in little-endian byte order.
@@ -730,7 +730,7 @@ pub trait Buf {
730
730
///
731
731
/// This function panics if there is not enough remaining data in `self`.
732
732
fn get_u128_le ( & mut self ) -> u128 {
733
- buf_get_impl ! ( self , u128 :: from_le_bytes) ;
733
+ buf_get_impl ! ( self , u128 :: from_le_bytes)
734
734
}
735
735
736
736
/// Gets an unsigned 128 bit integer from `self` in native-endian byte order.
@@ -753,7 +753,7 @@ pub trait Buf {
753
753
///
754
754
/// This function panics if there is not enough remaining data in `self`.
755
755
fn get_u128_ne ( & mut self ) -> u128 {
756
- buf_get_impl ! ( self , u128 :: from_ne_bytes) ;
756
+ buf_get_impl ! ( self , u128 :: from_ne_bytes)
757
757
}
758
758
759
759
/// Gets a signed 128 bit integer from `self` in big-endian byte order.
@@ -773,7 +773,7 @@ pub trait Buf {
773
773
///
774
774
/// This function panics if there is not enough remaining data in `self`.
775
775
fn get_i128 ( & mut self ) -> i128 {
776
- buf_get_impl ! ( self , i128 :: from_be_bytes) ;
776
+ buf_get_impl ! ( self , i128 :: from_be_bytes)
777
777
}
778
778
779
779
/// Gets a signed 128 bit integer from `self` in little-endian byte order.
@@ -793,7 +793,7 @@ pub trait Buf {
793
793
///
794
794
/// This function panics if there is not enough remaining data in `self`.
795
795
fn get_i128_le ( & mut self ) -> i128 {
796
- buf_get_impl ! ( self , i128 :: from_le_bytes) ;
796
+ buf_get_impl ! ( self , i128 :: from_le_bytes)
797
797
}
798
798
799
799
/// Gets a signed 128 bit integer from `self` in native-endian byte order.
@@ -816,7 +816,7 @@ pub trait Buf {
816
816
///
817
817
/// This function panics if there is not enough remaining data in `self`.
818
818
fn get_i128_ne ( & mut self ) -> i128 {
819
- buf_get_impl ! ( self , i128 :: from_ne_bytes) ;
819
+ buf_get_impl ! ( self , i128 :: from_ne_bytes)
820
820
}
821
821
822
822
/// Gets an unsigned n-byte integer from `self` in big-endian byte order.
@@ -836,7 +836,7 @@ pub trait Buf {
836
836
///
837
837
/// This function panics if there is not enough remaining data in `self`.
838
838
fn get_uint ( & mut self , nbytes : usize ) -> u64 {
839
- buf_get_impl ! ( be => self , u64 , nbytes) ;
839
+ buf_get_impl ! ( be => self , u64 , nbytes)
840
840
}
841
841
842
842
/// Gets an unsigned n-byte integer from `self` in little-endian byte order.
@@ -856,7 +856,7 @@ pub trait Buf {
856
856
///
857
857
/// This function panics if there is not enough remaining data in `self`.
858
858
fn get_uint_le ( & mut self , nbytes : usize ) -> u64 {
859
- buf_get_impl ! ( le => self , u64 , nbytes) ;
859
+ buf_get_impl ! ( le => self , u64 , nbytes)
860
860
}
861
861
862
862
/// Gets an unsigned n-byte integer from `self` in native-endian byte order.
@@ -903,7 +903,7 @@ pub trait Buf {
903
903
///
904
904
/// This function panics if there is not enough remaining data in `self`.
905
905
fn get_int ( & mut self , nbytes : usize ) -> i64 {
906
- buf_get_impl ! ( be => self , i64 , nbytes) ;
906
+ buf_get_impl ! ( be => self , i64 , nbytes)
907
907
}
908
908
909
909
/// Gets a signed n-byte integer from `self` in little-endian byte order.
@@ -923,7 +923,7 @@ pub trait Buf {
923
923
///
924
924
/// This function panics if there is not enough remaining data in `self`.
925
925
fn get_int_le ( & mut self , nbytes : usize ) -> i64 {
926
- buf_get_impl ! ( le => self , i64 , nbytes) ;
926
+ buf_get_impl ! ( le => self , i64 , nbytes)
927
927
}
928
928
929
929
/// Gets a signed n-byte integer from `self` in native-endian byte order.
0 commit comments