summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/manual_find.rs
blob: 257fe045f78a1d0d07f9724f184bb773c05f2bfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![allow(unused)]
#![warn(clippy::manual_find)]

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() {}