1 #![feature(tool_lints)]
7 #[allow(clippy::unnecessary_operation)]
9 "".chars().next() == Some(' ');
10 Some(' ') != "".chars().next();
13 fn chars_cmp_with_unwrap() {
14 let s = String::from("foo");
15 if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
18 if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
21 if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
24 if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
27 if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
30 if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
35 #[allow(clippy::unnecessary_operation)]
37 "".chars().last() == Some(' ');
38 Some(' ') != "".chars().last();
39 "".chars().next_back() == Some(' ');
40 Some(' ') != "".chars().next_back();