External Publication
Visit Post

Pre-feature request: suppress unused variable warning for unit-type arguments

Rust Internals [Unofficial] March 13, 2026
Source

zackw:

when, inevitably, the subcommand grows some options

Nemo157:

let SubcommandwithNoOptionsArgs { } = args;

I really like this solution, as it adds a place in the function where you acknowledge that it (currently) has no args.

Later if you add args, you get a nice error about missing fields, instead of a softer lint when it's no longer meeting the ZST special case. The hard error is much more clear in my opinion.

Discussion in the ATmosphere

Loading comments...