2 #![allow(dead_code, unused_must_use)]
6 #[allow(clippy::unnecessary_operation)]
8 "".chars().next() == Some(' ');
9 Some(' ') != "".chars().next();
11 // Ensure that suggestion is escaped correctly
12 "".chars().next() == Some('\n');
13 Some('\n') != "".chars().next();
16 fn chars_cmp_with_unwrap() {
17 let s = String::from("foo");
18 if s.chars().next().unwrap() == 'f' {
22 if s.chars().next_back().unwrap() == 'o' {
26 if s.chars().last().unwrap() == 'o' {
30 if s.chars().next().unwrap() != 'f' {
31 // !s.starts_with('f')
34 if s.chars().next_back().unwrap() != 'o' {
38 if s.chars().last().unwrap() != '\n' {
44 #[allow(clippy::unnecessary_operation)]
46 "".chars().last() == Some(' ');
47 Some(' ') != "".chars().last();
48 "".chars().next_back() == Some(' ');
49 Some(' ') != "".chars().next_back();
51 // Ensure that suggestion is escaped correctly
52 "".chars().last() == Some('\n');
53 Some('\n') != "".chars().last();