5 #[allow(unnecessary_operation)]
7 "".chars().next() == Some(' ');
8 Some(' ') != "".chars().next();
11 fn chars_cmp_with_unwrap() {
12 let s = String::from("foo");
13 if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
16 if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
19 if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
22 if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
25 if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
28 if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
33 #[allow(unnecessary_operation)]
35 "".chars().last() == Some(' ');
36 Some(' ') != "".chars().last();
37 "".chars().next_back() == Some(' ');
38 Some(' ') != "".chars().next_back();