Re: [PATCH net-next v3 2/8] rust: time: Introduce Delta type
From: FUJITA Tomonori
Date: Thu Oct 17 2024 - 07:25:09 EST
On Thu, 17 Oct 2024 12:17:18 +0200
Fiona Behrens <me@xxxxxxxxxx> wrote:
>> +/// A span of time.
>> +#[derive(Copy, Clone)]
>
> Could we also derive PartialEq and Eq (maybe also PartialOrd and
> Ord)? Would need that to compare deltas in my LED driver.
Sure, I'll add.
>> +pub struct Delta {
>> + nanos: i64,
>> +}
>> +
>
> I think all this functions could be const (need from_millis as const
> for LED, but when at it we could probably make all those const?)
I think that making all the from_* methods const fn make sense. I'll
do.