Open musjj opened 1 month ago
Unfortunately this isn't an issue with rustfmt. It's an issue with the compiler. Specifically the ast::Attribute::meta method, which is returning None
for your second example.
rustfmt uses the value it gets back from that call here to format the attribute, otherwise it'll leave the attribute unformatted.
https://github.com/rust-lang/rustfmt/blob/96cc01b197f50eeb657128946d02b8f61da2d12d/src/attr.rs#L350
A real-world example from nutype:
This gets formatted just fine:
But this does not:
It looks like that rustfmt is not liking the
EMAIL_REGEX
here, but I'm not sure why.Tested on
rustfmt 1.8.0-nightly (3ed6e3cc69 2024-10-17)
.