1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
10 use std::collections::HashSet;
20 // Not yet testing for multi-byte characters
21 // Changing `r.len() == 1` to `r.chars().count() == 1` in `lint_clippy::single_char_pattern`
22 // should have done this but produced an ICE
24 // We may not want to suggest changing these anyway
25 // See: https://github.com/rust-lang/rust-clippy/issues/650#issuecomment-184328984
29 // Can't use this lint for unicode code points which don't fit in a char
37 x.split_terminator("x");
38 x.rsplit_terminator("x");
44 x.rmatch_indices("x");
45 x.trim_left_matches("x");
46 x.trim_right_matches("x");
47 // Make sure we escape characters correctly.
50 let h = HashSet::<String>::new();
51 h.contains("X"); // should not warn
53 x.replace(";", ",").split(","); // issue #2978
54 x.starts_with("\x03"); // issue #2996