-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messages
Description
Our Sugg
builder type has support for many code snippets, but in some cases we still fall back to strings. One such case is
rust-clippy/clippy_lints/src/needless_bool.rs
Lines 77 to 83 in 0a0792e
format!("return {}", snip) | |
} else { | |
snip.to_string() | |
}; | |
if parent_node_is_if_expr(&e, &cx) { | |
hint = format!("{{ {} }}", hint); |
There are probably more, but for now we should add methods for
return $sugg
(e.g. areturn_expr
method that wraps the current suggestion in areturn
call)- blockifying (turns the current suggestion into a block where the current suggestion is the trailing expression)
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messages