You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clippy should detect unnecessary format! blocks, such as panic!(format!( and others.
The text was updated successfully, but these errors were encountered:
flip1995
added
L-perf
Lint: Belongs in the perf lint group
A-lint
Area: New lints
T-macros
Type: Issues with macros and macro expansion
L-style
Lint: Belongs in the style lint group
and removed
L-perf
Lint: Belongs in the perf lint group
labels
Jan 7, 2020
clippy should detect unnecessary format! blocks, such as panic!(format!( and others.
Can you be more specific in which cases this should be added? I guess you refer to some sort of short circuiting that makes some expression to remain unevaluated no matter what. Is that correct?
In particular, the case with panic! and format! does not follow those rules. For instance
#[derive(Debug)]structWhatever;fnmain(){let b = Whatever;panic!(format!("^^ {:?} ^^ ", b))// prints ^^ Whatever ^^}
panic!(format!(..)) is always weird, since panic!() uses the same formatting syntax as fromat! and you could just remove the format! and it'll have the same output.
clippy should detect unnecessary
format!
blocks, such aspanic!(format!(
and others.The text was updated successfully, but these errors were encountered: