rust-clippy/tests/ui/manual_find.rs
2023-08-11 14:02:28 +00:00

22 lines
408 B
Rust

#![allow(unused)]
#![warn(clippy::manual_find)]
//@no-rustfix
fn vec_string(strings: Vec<String>) -> Option<String> {
for s in strings {
if s == String::new() {
return Some(s);
}
}
None
}
fn tuple(arr: Vec<(String, i32)>) -> Option<String> {
for (s, _) in arr {
if s == String::new() {
return Some(s);
}
}
None
}
fn main() {}