Re: [PATCH v1 4/5] rust: time: Make HasHrTimer generic over HrTimerMode

From: Andreas Hindborg
Date: Tue Jun 03 2025 - 12:31:10 EST


"FUJITA Tomonori" <fujita.tomonori@xxxxxxxxx> writes:

> On Mon, 02 Jun 2025 14:41:10 +0200
> Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
>>> @@ -579,12 +604,16 @@ macro_rules! impl_has_hr_timer {
>>> impl$({$($generics:tt)*})?
>>> HasHrTimer<$timer_type:ty>
>>> for $self:ty
>>> - { self.$field:ident }
>>> + {
>>> + mode = $mode:ty,
>>> + self.$field:ident
>>
>> How about:
>>
>> mode = $mode:ty,
>> field = self.$field:ident
>
> Works fo me.
>
>> So that there is some sort of red line when calling this. We could also
>> consider adopting another syntax for association:
>>
>> mode: $mode:ty,
>> field: self.$field:ident
>
> Looks fine too.
>
>> or something else like `<-` or `->` ?
>
> I personally prefer one of the two options above, but I'm also ok with
> `<-` or `->`.

OK, let's go with struct initializer syntax then (:). We can always
change it later if someone has a different opinion.


Best regards,
Andreas Hindborg