Re: [PATCH 2/9] rust: list: add tracking for ListArc

From: Benno Lossin
Date: Thu Apr 04 2024 - 10:42:22 EST


On 04.04.24 16:14, Alice Ryhl wrote:
> On Wed, Apr 3, 2024 at 5:52 PM Benno Lossin <benno.lossin@xxxxxxxxx> wrote:
>> On 02.04.24 14:16, Alice Ryhl wrote:
>>> + unsafe { <$fty as $crate::list::ListArcSafe<$num>>::on_create_list_arc_from_unique(
>>> + &mut *field
>>> + ) };
>>
>> Formatting? rustfmt gives me this:
>>
>> unsafe {
>> <$fty as $crate::list::ListArcSafe<$num>>::on_create_list_arc_from_unique(
>> &mut *field
>> )
>> };
>>
>> (maybe the `;` should be inside the `unsafe` block in this case?)
>
> I can make the change, but rustfmt does not affect macros.

I think we still should try to format macros correctly, it increases
readability. I take the in-macro code, remove all `$` and other
macro-only symbols, then use rustfmt and then manually format the code
accordingly. I also find it tedious, but the unformatted code also
doesn't look good :)

--
Cheers,
Benno