Open
Description
What it does
Inspired by this issue:
rust-lang/rust#91625
In code like this:
fn main() {
let s = "abc".to_string();
let t = s.strip_prefix(&['a', 'x'][..]);
println!("{:?}", t);
}
Clippy could suggest to write instead:
s.strip_prefix(&['a', 'x'])
Or even:
s.strip_prefix(['a', 'x'])
Lint Name
No response
Category
No response
Advantage
No response
Drawbacks
No response
Example
<code>
Could be written as:
<code>