2022-04-06 16:28:49 +00:00
|
|
|
#![allow(unused)]
|
|
|
|
#![warn(clippy::manual_find)]
|
2023-07-27 11:40:22 +00:00
|
|
|
//@no-rustfix
|
2022-04-06 16:28:49 +00:00
|
|
|
fn vec_string(strings: Vec<String>) -> Option<String> {
|
|
|
|
for s in strings {
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: manual implementation of `Iterator::find`
|
|
|
|
//~| NOTE: you may need to dereference some variables
|
2022-04-06 16:28:49 +00:00
|
|
|
if s == String::new() {
|
|
|
|
return Some(s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
|
|
|
fn tuple(arr: Vec<(String, i32)>) -> Option<String> {
|
|
|
|
for (s, _) in arr {
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: manual implementation of `Iterator::find`
|
|
|
|
//~| NOTE: you may need to dereference some variables
|
2022-04-06 16:28:49 +00:00
|
|
|
if s == String::new() {
|
|
|
|
return Some(s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|