Definitely agree here.
No, unfortunately I don’t. I’d have to put some thought into it. I’d really need to check and see what the current Rustfmt options are named for formatting/styling trailing commas style.
As far as what the style should be, I think the examples you showed should be good guidance. I would, however, tend to want to prefer not having leading (or trailing) commas if it is all on one line, so, to me (opinion only, which isn’t worth much)
let (, b): (, usize) = (, 2);
// equivalent to:
let (b,): (usize,) = (2,);
let (, a, b, c): (, usize, usize, usize) =
(
, 42
, 1337
, 42
);
Would be discouraged and instead would prefer this:
let (b): (usize) = (2);
// equivalent to:
let (b): (usize) = (2);
let (a, b, c): (usize, usize, usize) =
(
, 42
, 1337
, 42
);
Notice, no leading/trailing commas on the one-liners above.
That being said, it wold be nice if this also were optional and could be toggled as well if the author so preferred.