Closed
Description
In the following snippet, there is a trailing comment following the entire builder chain after normal_message
:
// Client set up {{{
discord_client.with_framework(
StandardFramework::new()
// Framework configuration {{{{
.configure(|c| {
c.with_whitespace(true) // allow `{prefix} command`
.case_insensitivity(true) // allow `{prefix}cOmMaNd`
.no_dm_prefix(true) // allow `command` in DMs
.prefix(config.prefix()) // set the prefix to use for commands
.delimiters(vec![" "]) // split arguments at space; `{prefix} test a b c` => [{prefix test}, a, b, c]
})
// Normal message {{{{
.normal_message(|_ctx, _msg| {
})
// }}}}
,
// wee
);
// }}}
When I run rustfmt
on this with default settings:
$ rustfmt --version
rustfmt 1.4.8-nightly (afb1ee1 2019-09-08)
I get this result:
// Client set up {{{
discord_client.with_framework(
StandardFramework::new()
// Framework configuration {{{{
.configure(|c| {
c.with_whitespace(true) // allow `{prefix} command`
.case_insensitivity(true) // allow `{prefix}cOmMaNd`
.no_dm_prefix(true) // allow `command` in DMs
.prefix(config.prefix()) // set the prefix to use for commands
.delimiters(vec![" "]) // split arguments at space; `{prefix} test a b c` => [{prefix test}, a, b, c]
})
// Normal message {{{{
.normal_message(|_ctx, _msg| {}), // }}}}
, // uh oh.. there's a comma over this one as well! ;o
// wee
);
// }}}
The comma clearly duplicated where it wasn't supposed to.
The //uh oh comment was added in the issue creation; the rest was from my source code, except "a bit" stripped down.