diff --git a/packages/std/src/timestamp.rs b/packages/std/src/timestamp.rs index e623478962..f3491b3a0b 100644 --- a/packages/std/src/timestamp.rs +++ b/packages/std/src/timestamp.rs @@ -56,11 +56,13 @@ impl Timestamp { } #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] pub const fn plus_seconds(&self, addition: u64) -> Timestamp { self.plus_nanos(addition * 1_000_000_000) } #[must_use = "this returns the result of the operation, without modifying the original"] + // no #[inline] here as this could be shared with all the callers pub const fn plus_nanos(&self, addition: u64) -> Timestamp { let nanos = Uint64::new(self.0.u64() + addition); Timestamp(nanos) @@ -101,6 +103,7 @@ impl Timestamp { /// /// Panics if the result is not >= 0. I.e. times before epoch cannot be represented. #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] pub const fn minus_seconds(&self, subtrahend: u64) -> Timestamp { self.minus_nanos(subtrahend * 1_000_000_000) } @@ -110,6 +113,7 @@ impl Timestamp { /// /// Panics if the result is not >= 0. I.e. times before epoch cannot be represented. #[must_use = "this returns the result of the operation, without modifying the original"] + // no #[inline] here as this could be shared with all the callers pub const fn minus_nanos(&self, subtrahend: u64) -> Timestamp { Timestamp(self.0.panicking_sub(Uint64::new(subtrahend))) }