Re: [PATCH v4 2/7] rust: time: Introduce Delta type

From: Andrew Lunn
Date: Fri Oct 25 2024 - 18:34:06 EST


> + /// Return the number of nanoseconds in the `Delta`.
> + #[inline]
> + pub fn as_nanos(self) -> i64 {
> + self.nanos
> + }
> +
> + /// Return the smallest number of microseconds greater than or equal
> + /// to the value in the `Delta`.
> + #[inline]
> + pub fn as_micros_ceil(self) -> i64 {
> + self.as_nanos().saturating_add(NSEC_PER_USEC - 1) / NSEC_PER_USEC
> + }

Thanks for dropping all the unsued as_foo helpers, and adding just the
one needed.

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew