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.
12 use std::collections::HashSet;
22 // Not yet testing for multi-byte characters
23 // Changing `r.len() == 1` to `r.chars().count() == 1` in `lint_clippy::single_char_pattern`
24 // should have done this but produced an ICE
26 // We may not want to suggest changing these anyway
27 // See: https://github.com/rust-lang/rust-clippy/issues/650#issuecomment-184328984
31 // Can't use this lint for unicode code points which don't fit in a char
39 x.split_terminator("x");
40 x.rsplit_terminator("x");
46 x.rmatch_indices("x");
47 x.trim_start_matches("x");
48 x.trim_end_matches("x");
49 // Make sure we escape characters correctly.
52 let h = HashSet::<String>::new();
53 h.contains("X"); // should not warn
55 x.replace(";", ",").split(","); // issue #2978
56 x.starts_with("\x03"); // issue #2996