@@ -56,11 +56,13 @@ impl Timestamp {
56
56
}
57
57
58
58
#[ must_use = "this returns the result of the operation, without modifying the original" ]
59
+ #[ inline]
59
60
pub const fn plus_seconds ( & self , addition : u64 ) -> Timestamp {
60
61
self . plus_nanos ( addition * 1_000_000_000 )
61
62
}
62
63
63
64
#[ must_use = "this returns the result of the operation, without modifying the original" ]
65
+ // no #[inline] here as this could be shared with all the callers
64
66
pub const fn plus_nanos ( & self , addition : u64 ) -> Timestamp {
65
67
let nanos = Uint64 :: new ( self . 0 . u64 ( ) + addition) ;
66
68
Timestamp ( nanos)
@@ -101,6 +103,7 @@ impl Timestamp {
101
103
///
102
104
/// Panics if the result is not >= 0. I.e. times before epoch cannot be represented.
103
105
#[ must_use = "this returns the result of the operation, without modifying the original" ]
106
+ #[ inline]
104
107
pub const fn minus_seconds ( & self , subtrahend : u64 ) -> Timestamp {
105
108
self . minus_nanos ( subtrahend * 1_000_000_000 )
106
109
}
@@ -110,6 +113,7 @@ impl Timestamp {
110
113
///
111
114
/// Panics if the result is not >= 0. I.e. times before epoch cannot be represented.
112
115
#[ must_use = "this returns the result of the operation, without modifying the original" ]
116
+ // no #[inline] here as this could be shared with all the callers
113
117
pub const fn minus_nanos ( & self , subtrahend : u64 ) -> Timestamp {
114
118
Timestamp ( self . 0 . panicking_sub ( Uint64 :: new ( subtrahend) ) )
115
119
}
0 commit comments