@@ -910,13 +910,15 @@ impl Duration {
910
910
impl Add for Duration {
911
911
type Output = Duration ;
912
912
913
+ #[ inline]
913
914
fn add ( self , rhs : Duration ) -> Duration {
914
915
self . checked_add ( rhs) . expect ( "overflow when adding durations" )
915
916
}
916
917
}
917
918
918
919
#[ stable( feature = "time_augmented_assignment" , since = "1.9.0" ) ]
919
920
impl AddAssign for Duration {
921
+ #[ inline]
920
922
fn add_assign ( & mut self , rhs : Duration ) {
921
923
* self = * self + rhs;
922
924
}
@@ -926,13 +928,15 @@ impl AddAssign for Duration {
926
928
impl Sub for Duration {
927
929
type Output = Duration ;
928
930
931
+ #[ inline]
929
932
fn sub ( self , rhs : Duration ) -> Duration {
930
933
self . checked_sub ( rhs) . expect ( "overflow when subtracting durations" )
931
934
}
932
935
}
933
936
934
937
#[ stable( feature = "time_augmented_assignment" , since = "1.9.0" ) ]
935
938
impl SubAssign for Duration {
939
+ #[ inline]
936
940
fn sub_assign ( & mut self , rhs : Duration ) {
937
941
* self = * self - rhs;
938
942
}
@@ -942,6 +946,7 @@ impl SubAssign for Duration {
942
946
impl Mul < u32 > for Duration {
943
947
type Output = Duration ;
944
948
949
+ #[ inline]
945
950
fn mul ( self , rhs : u32 ) -> Duration {
946
951
self . checked_mul ( rhs) . expect ( "overflow when multiplying duration by scalar" )
947
952
}
@@ -951,13 +956,15 @@ impl Mul<u32> for Duration {
951
956
impl Mul < Duration > for u32 {
952
957
type Output = Duration ;
953
958
959
+ #[ inline]
954
960
fn mul ( self , rhs : Duration ) -> Duration {
955
961
rhs * self
956
962
}
957
963
}
958
964
959
965
#[ stable( feature = "time_augmented_assignment" , since = "1.9.0" ) ]
960
966
impl MulAssign < u32 > for Duration {
967
+ #[ inline]
961
968
fn mul_assign ( & mut self , rhs : u32 ) {
962
969
* self = * self * rhs;
963
970
}
@@ -967,13 +974,15 @@ impl MulAssign<u32> for Duration {
967
974
impl Div < u32 > for Duration {
968
975
type Output = Duration ;
969
976
977
+ #[ inline]
970
978
fn div ( self , rhs : u32 ) -> Duration {
971
979
self . checked_div ( rhs) . expect ( "divide by zero error when dividing duration by scalar" )
972
980
}
973
981
}
974
982
975
983
#[ stable( feature = "time_augmented_assignment" , since = "1.9.0" ) ]
976
984
impl DivAssign < u32 > for Duration {
985
+ #[ inline]
977
986
fn div_assign ( & mut self , rhs : u32 ) {
978
987
* self = * self / rhs;
979
988
}
0 commit comments