@@ -451,7 +451,7 @@ macro_rules! int_impl {
451
451
#[ inline]
452
452
pub const fn checked_add( self , rhs: Self ) -> Option <Self > {
453
453
let ( a, b) = self . overflowing_add( rhs) ;
454
- if unlikely!( b) { None } else { Some ( a) }
454
+ if unlikely!( b) { None } else { Some ( a) }
455
455
}
456
456
457
457
/// Strict integer addition. Computes `self + rhs`, panicking
@@ -461,7 +461,7 @@ macro_rules! int_impl {
461
461
///
462
462
/// ## Overflow behavior
463
463
///
464
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
464
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
465
465
///
466
466
/// # Examples
467
467
///
@@ -484,7 +484,7 @@ macro_rules! int_impl {
484
484
#[ track_caller]
485
485
pub const fn strict_add( self , rhs: Self ) -> Self {
486
486
let ( a, b) = self . overflowing_add( rhs) ;
487
- if unlikely!( b) { overflow_panic:: add( ) } else { a }
487
+ if unlikely!( b) { overflow_panic:: add( ) } else { a }
488
488
}
489
489
490
490
/// Unchecked integer addition. Computes `self + rhs`, assuming overflow
@@ -531,7 +531,7 @@ macro_rules! int_impl {
531
531
#[ inline]
532
532
pub const fn checked_add_unsigned( self , rhs: $UnsignedT) -> Option <Self > {
533
533
let ( a, b) = self . overflowing_add_unsigned( rhs) ;
534
- if unlikely!( b) { None } else { Some ( a) }
534
+ if unlikely!( b) { None } else { Some ( a) }
535
535
}
536
536
537
537
/// Strict addition with an unsigned integer. Computes `self + rhs`,
@@ -541,7 +541,7 @@ macro_rules! int_impl {
541
541
///
542
542
/// ## Overflow behavior
543
543
///
544
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
544
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
545
545
///
546
546
/// # Examples
547
547
///
@@ -564,7 +564,7 @@ macro_rules! int_impl {
564
564
#[ track_caller]
565
565
pub const fn strict_add_unsigned( self , rhs: $UnsignedT) -> Self {
566
566
let ( a, b) = self . overflowing_add_unsigned( rhs) ;
567
- if unlikely!( b) { overflow_panic:: add( ) } else { a }
567
+ if unlikely!( b) { overflow_panic:: add( ) } else { a }
568
568
}
569
569
570
570
/// Checked integer subtraction. Computes `self - rhs`, returning `None` if
@@ -585,7 +585,7 @@ macro_rules! int_impl {
585
585
#[ inline]
586
586
pub const fn checked_sub( self , rhs: Self ) -> Option <Self > {
587
587
let ( a, b) = self . overflowing_sub( rhs) ;
588
- if unlikely!( b) { None } else { Some ( a) }
588
+ if unlikely!( b) { None } else { Some ( a) }
589
589
}
590
590
591
591
/// Strict integer subtraction. Computes `self - rhs`, panicking if
@@ -595,7 +595,7 @@ macro_rules! int_impl {
595
595
///
596
596
/// ## Overflow behavior
597
597
///
598
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
598
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
599
599
///
600
600
/// # Examples
601
601
///
@@ -618,7 +618,7 @@ macro_rules! int_impl {
618
618
#[ track_caller]
619
619
pub const fn strict_sub( self , rhs: Self ) -> Self {
620
620
let ( a, b) = self . overflowing_sub( rhs) ;
621
- if unlikely!( b) { overflow_panic:: sub( ) } else { a }
621
+ if unlikely!( b) { overflow_panic:: sub( ) } else { a }
622
622
}
623
623
624
624
/// Unchecked integer subtraction. Computes `self - rhs`, assuming overflow
@@ -665,7 +665,7 @@ macro_rules! int_impl {
665
665
#[ inline]
666
666
pub const fn checked_sub_unsigned( self , rhs: $UnsignedT) -> Option <Self > {
667
667
let ( a, b) = self . overflowing_sub_unsigned( rhs) ;
668
- if unlikely!( b) { None } else { Some ( a) }
668
+ if unlikely!( b) { None } else { Some ( a) }
669
669
}
670
670
671
671
/// Strict subtraction with an unsigned integer. Computes `self - rhs`,
@@ -675,7 +675,7 @@ macro_rules! int_impl {
675
675
///
676
676
/// ## Overflow behavior
677
677
///
678
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
678
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
679
679
///
680
680
/// # Examples
681
681
///
@@ -698,7 +698,7 @@ macro_rules! int_impl {
698
698
#[ track_caller]
699
699
pub const fn strict_sub_unsigned( self , rhs: $UnsignedT) -> Self {
700
700
let ( a, b) = self . overflowing_sub_unsigned( rhs) ;
701
- if unlikely!( b) { overflow_panic:: sub( ) } else { a }
701
+ if unlikely!( b) { overflow_panic:: sub( ) } else { a }
702
702
}
703
703
704
704
/// Checked integer multiplication. Computes `self * rhs`, returning `None` if
@@ -719,7 +719,7 @@ macro_rules! int_impl {
719
719
#[ inline]
720
720
pub const fn checked_mul( self , rhs: Self ) -> Option <Self > {
721
721
let ( a, b) = self . overflowing_mul( rhs) ;
722
- if unlikely!( b) { None } else { Some ( a) }
722
+ if unlikely!( b) { None } else { Some ( a) }
723
723
}
724
724
725
725
/// Strict integer multiplication. Computes `self * rhs`, panicking if
@@ -729,7 +729,7 @@ macro_rules! int_impl {
729
729
///
730
730
/// ## Overflow behavior
731
731
///
732
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
732
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
733
733
///
734
734
/// # Examples
735
735
///
@@ -752,7 +752,7 @@ macro_rules! int_impl {
752
752
#[ track_caller]
753
753
pub const fn strict_mul( self , rhs: Self ) -> Self {
754
754
let ( a, b) = self . overflowing_mul( rhs) ;
755
- if unlikely!( b) { overflow_panic:: mul( ) } else { a }
755
+ if unlikely!( b) { overflow_panic:: mul( ) } else { a }
756
756
}
757
757
758
758
/// Unchecked integer multiplication. Computes `self * rhs`, assuming overflow
@@ -816,7 +816,7 @@ macro_rules! int_impl {
816
816
///
817
817
/// ## Overflow behavior
818
818
///
819
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
819
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
820
820
///
821
821
/// The only case where such an overflow can occur is when one divides `MIN / -1` on a signed type (where
822
822
/// `MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value
@@ -848,7 +848,7 @@ macro_rules! int_impl {
848
848
#[ track_caller]
849
849
pub const fn strict_div( self , rhs: Self ) -> Self {
850
850
let ( a, b) = self . overflowing_div( rhs) ;
851
- if unlikely!( b) { overflow_panic:: div( ) } else { a }
851
+ if unlikely!( b) { overflow_panic:: div( ) } else { a }
852
852
}
853
853
854
854
/// Checked Euclidean division. Computes `self.div_euclid(rhs)`,
@@ -886,7 +886,7 @@ macro_rules! int_impl {
886
886
///
887
887
/// ## Overflow behavior
888
888
///
889
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
889
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
890
890
///
891
891
/// The only case where such an overflow can occur is when one divides `MIN / -1` on a signed type (where
892
892
/// `MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value
@@ -918,7 +918,7 @@ macro_rules! int_impl {
918
918
#[ track_caller]
919
919
pub const fn strict_div_euclid( self , rhs: Self ) -> Self {
920
920
let ( a, b) = self . overflowing_div_euclid( rhs) ;
921
- if unlikely!( b) { overflow_panic:: div( ) } else { a }
921
+ if unlikely!( b) { overflow_panic:: div( ) } else { a }
922
922
}
923
923
924
924
/// Checked integer remainder. Computes `self % rhs`, returning `None` if
@@ -956,7 +956,7 @@ macro_rules! int_impl {
956
956
///
957
957
/// ## Overflow behavior
958
958
///
959
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
959
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
960
960
///
961
961
/// The only case where such an overflow can occur is `x % y` for `MIN / -1` on a
962
962
/// signed type (where `MIN` is the negative minimal value), which is invalid due to implementation artifacts.
@@ -987,7 +987,7 @@ macro_rules! int_impl {
987
987
#[ track_caller]
988
988
pub const fn strict_rem( self , rhs: Self ) -> Self {
989
989
let ( a, b) = self . overflowing_rem( rhs) ;
990
- if unlikely!( b) { overflow_panic:: rem( ) } else { a }
990
+ if unlikely!( b) { overflow_panic:: rem( ) } else { a }
991
991
}
992
992
993
993
/// Checked Euclidean remainder. Computes `self.rem_euclid(rhs)`, returning `None`
@@ -1025,7 +1025,7 @@ macro_rules! int_impl {
1025
1025
///
1026
1026
/// ## Overflow behavior
1027
1027
///
1028
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
1028
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
1029
1029
///
1030
1030
/// The only case where such an overflow can occur is `x % y` for `MIN / -1` on a
1031
1031
/// signed type (where `MIN` is the negative minimal value), which is invalid due to implementation artifacts.
@@ -1056,7 +1056,7 @@ macro_rules! int_impl {
1056
1056
#[ track_caller]
1057
1057
pub const fn strict_rem_euclid( self , rhs: Self ) -> Self {
1058
1058
let ( a, b) = self . overflowing_rem_euclid( rhs) ;
1059
- if unlikely!( b) { overflow_panic:: rem( ) } else { a }
1059
+ if unlikely!( b) { overflow_panic:: rem( ) } else { a }
1060
1060
}
1061
1061
1062
1062
/// Checked negation. Computes `-self`, returning `None` if `self == MIN`.
@@ -1076,7 +1076,7 @@ macro_rules! int_impl {
1076
1076
#[ inline]
1077
1077
pub const fn checked_neg( self ) -> Option <Self > {
1078
1078
let ( a, b) = self . overflowing_neg( ) ;
1079
- if unlikely!( b) { None } else { Some ( a) }
1079
+ if unlikely!( b) { None } else { Some ( a) }
1080
1080
}
1081
1081
1082
1082
/// Unchecked negation. Computes `-self`, assuming overflow cannot occur.
@@ -1110,7 +1110,7 @@ macro_rules! int_impl {
1110
1110
///
1111
1111
/// ## Overflow behavior
1112
1112
///
1113
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
1113
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
1114
1114
///
1115
1115
/// # Examples
1116
1116
///
@@ -1133,7 +1133,7 @@ macro_rules! int_impl {
1133
1133
#[ track_caller]
1134
1134
pub const fn strict_neg( self ) -> Self {
1135
1135
let ( a, b) = self . overflowing_neg( ) ;
1136
- if unlikely!( b) { overflow_panic:: neg( ) } else { a }
1136
+ if unlikely!( b) { overflow_panic:: neg( ) } else { a }
1137
1137
}
1138
1138
1139
1139
/// Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger
@@ -1154,7 +1154,7 @@ macro_rules! int_impl {
1154
1154
#[ inline]
1155
1155
pub const fn checked_shl( self , rhs: u32 ) -> Option <Self > {
1156
1156
let ( a, b) = self . overflowing_shl( rhs) ;
1157
- if unlikely!( b) { None } else { Some ( a) }
1157
+ if unlikely!( b) { None } else { Some ( a) }
1158
1158
}
1159
1159
1160
1160
/// Strict shift left. Computes `self << rhs`, panicking if `rhs` is larger
@@ -1164,7 +1164,7 @@ macro_rules! int_impl {
1164
1164
///
1165
1165
/// ## Overflow behavior
1166
1166
///
1167
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
1167
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
1168
1168
///
1169
1169
/// # Examples
1170
1170
///
@@ -1187,7 +1187,7 @@ macro_rules! int_impl {
1187
1187
#[ track_caller]
1188
1188
pub const fn strict_shl( self , rhs: u32 ) -> Self {
1189
1189
let ( a, b) = self . overflowing_shl( rhs) ;
1190
- if unlikely!( b) { overflow_panic:: shl( ) } else { a }
1190
+ if unlikely!( b) { overflow_panic:: shl( ) } else { a }
1191
1191
}
1192
1192
1193
1193
/// Unchecked shift left. Computes `self << rhs`, assuming that
@@ -1235,7 +1235,7 @@ macro_rules! int_impl {
1235
1235
#[ inline]
1236
1236
pub const fn checked_shr( self , rhs: u32 ) -> Option <Self > {
1237
1237
let ( a, b) = self . overflowing_shr( rhs) ;
1238
- if unlikely!( b) { None } else { Some ( a) }
1238
+ if unlikely!( b) { None } else { Some ( a) }
1239
1239
}
1240
1240
1241
1241
/// Strict shift right. Computes `self >> rhs`, panicking `rhs` is
@@ -1245,7 +1245,7 @@ macro_rules! int_impl {
1245
1245
///
1246
1246
/// ## Overflow behavior
1247
1247
///
1248
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
1248
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
1249
1249
///
1250
1250
/// # Examples
1251
1251
///
@@ -1268,7 +1268,7 @@ macro_rules! int_impl {
1268
1268
#[ track_caller]
1269
1269
pub const fn strict_shr( self , rhs: u32 ) -> Self {
1270
1270
let ( a, b) = self . overflowing_shr( rhs) ;
1271
- if unlikely!( b) { overflow_panic:: shr( ) } else { a }
1271
+ if unlikely!( b) { overflow_panic:: shr( ) } else { a }
1272
1272
}
1273
1273
1274
1274
/// Unchecked shift right. Computes `self >> rhs`, assuming that
@@ -1329,7 +1329,7 @@ macro_rules! int_impl {
1329
1329
///
1330
1330
/// ## Overflow behavior
1331
1331
///
1332
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
1332
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
1333
1333
///
1334
1334
/// # Examples
1335
1335
///
@@ -1403,7 +1403,7 @@ macro_rules! int_impl {
1403
1403
///
1404
1404
/// ## Overflow behavior
1405
1405
///
1406
- /// This function will always panic on overflow, regardless of if overflow checks are enabled.
1406
+ /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
1407
1407
///
1408
1408
/// # Examples
1409
1409
///
0 commit comments