Re: [PATCH] [PATCH] rust: macros: add authors

From: Daniel Sedlak
Date: Sat Dec 07 2024 - 05:15:15 EST




On 12/6/24 9:17 PM, Miguel Ojeda wrote:
There are several ways we could do this:

- A single field, that only accepts a list.

- A single field that accepts both a string or a list.

Since module is a macro, if we would allow syntax in the macro like:

authors: ["author1", "author2", ...]

I think we could fight with the code formatting, because when it comes to the rust macros, rustfmt is often very confused and we could end up with variations like:

authors: ["author1", "author2",
"author3"]

or

authors: [
"author1",
"author2",
]

and rustfmt would be totally ok with both of them.


- Two fields like this (that cannot coexist).

- Accepting several "author" fields and append them all into a list.


I think accepting several "author" fields is the best one because it mirrors the C API, where in C when you want to specify more authors you just repeat the MODULE_AUTHOR("author<N>") macro.