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

From: FUJITA Tomonori
Date: Tue Jun 03 2025 - 10:09:42 EST


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 `->`.