-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
Summary
When applying the single_match_else suggestion, the output introduces a violation of semicolon_if_nothing_returned.
Reproducer
Code:
match parse_char_escape(line) {
Some(decoded) => result.push(decoded),
None => {
result.push('\\');
result.push(line.current());
line.advance();
}
}Current output:
if let Some(decoded) = parse_char_escape(line) {
result.push(decoded) // semicolon_if_nothing_returned
} else {
result.push('\\');
result.push(line.current());
line.advance();
}Desired output:
if let Some(decoded) = parse_char_escape(line) {
result.push(decoded);
} else {
result.push('\\');
result.push(line.current());
line.advance();
}Version
nightly
Additional Labels
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing