{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreici53elqcmzywwi2bapq7h72hvdnwac5j4xwix7zf3g7tmelu33pi",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgrhwcy5fy72"
},
"path": "/t/pre-feature-request-suppress-unused-variable-warning-for-unit-type-arguments/24065#post_5",
"publishedAt": "2026-03-10T18:01:25.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "If you want to suppress it but also clarify to the reader that no data is lost, you can also use a pattern in the argument; never creating any unused variable either. This may be best if the name is not obviously a token type.\n\n\n #[derive(Clone, Debug, Args)]\n pub struct SubcommandWithNoOptionsArgs;\n\n pub fn subcommand_with_no_options_run(\n SubcommandWithNoOptionsArgs: SubcommandWithNoOptionsArgs\n ) …\n\n\nIn terms of readability this looks odd at first but seems fine to me overall. My gut wants this to be an example motivating (limited) type deduction for arguments to avoid the duplication but that would be just a different token soup and honestly is very niche.",
"title": "Pre-feature request: suppress unused variable warning for unit-type arguments"
}