Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/ui/single_char_pattern.fixed
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(clippy::needless_raw_strings, clippy::needless_raw_string_hashes, unused_must_use)]
#![warn(clippy::single_char_pattern)]
use std::collections::HashSet;

Expand Down
1 change: 0 additions & 1 deletion tests/ui/single_char_pattern.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(clippy::needless_raw_strings, clippy::needless_raw_string_hashes, unused_must_use)]
#![warn(clippy::single_char_pattern)]
use std::collections::HashSet;

Expand Down
70 changes: 35 additions & 35 deletions tests/ui/single_char_pattern.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:7:13
--> tests/ui/single_char_pattern.rs:6:13
|
LL | x.split("x");
| ^^^ help: consider using a `char`: `'x'`
Expand All @@ -8,205 +8,205 @@ LL | x.split("x");
= help: to override `-D warnings` add `#[allow(clippy::single_char_pattern)]`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:19:23
--> tests/ui/single_char_pattern.rs:18:23
|
LL | x.split_inclusive("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:21:16
--> tests/ui/single_char_pattern.rs:20:16
|
LL | x.contains("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:23:19
--> tests/ui/single_char_pattern.rs:22:19
|
LL | x.starts_with("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:25:17
--> tests/ui/single_char_pattern.rs:24:17
|
LL | x.ends_with("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:27:12
--> tests/ui/single_char_pattern.rs:26:12
|
LL | x.find("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:29:13
--> tests/ui/single_char_pattern.rs:28:13
|
LL | x.rfind("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:31:14
--> tests/ui/single_char_pattern.rs:30:14
|
LL | x.rsplit("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:33:24
--> tests/ui/single_char_pattern.rs:32:24
|
LL | x.split_terminator("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:35:25
--> tests/ui/single_char_pattern.rs:34:25
|
LL | x.rsplit_terminator("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:37:17
--> tests/ui/single_char_pattern.rs:36:17
|
LL | x.splitn(2, "x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:39:18
--> tests/ui/single_char_pattern.rs:38:18
|
LL | x.rsplitn(2, "x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:41:18
--> tests/ui/single_char_pattern.rs:40:18
|
LL | x.split_once("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:43:19
--> tests/ui/single_char_pattern.rs:42:19
|
LL | x.rsplit_once("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:45:15
--> tests/ui/single_char_pattern.rs:44:15
|
LL | x.matches("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:47:16
--> tests/ui/single_char_pattern.rs:46:16
|
LL | x.rmatches("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:49:21
--> tests/ui/single_char_pattern.rs:48:21
|
LL | x.match_indices("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:51:22
--> tests/ui/single_char_pattern.rs:50:22
|
LL | x.rmatch_indices("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:53:26
--> tests/ui/single_char_pattern.rs:52:26
|
LL | x.trim_start_matches("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:55:24
--> tests/ui/single_char_pattern.rs:54:24
|
LL | x.trim_end_matches("x");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:57:15
--> tests/ui/single_char_pattern.rs:56:15
|
LL | x.replace("x", "y");
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:59:16
--> tests/ui/single_char_pattern.rs:58:16
|
LL | x.replacen("x", "y", 3);
| ^^^ help: consider using a `char`: `'x'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:62:13
--> tests/ui/single_char_pattern.rs:61:13
|
LL | x.split("\n");
| ^^^^ help: consider using a `char`: `'\n'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:64:13
--> tests/ui/single_char_pattern.rs:63:13
|
LL | x.split("'");
| ^^^ help: consider using a `char`: `'\''`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:66:13
--> tests/ui/single_char_pattern.rs:65:13
|
LL | x.split("\'");
| ^^^^ help: consider using a `char`: `'\''`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:69:13
--> tests/ui/single_char_pattern.rs:68:13
|
LL | x.split("\"");
| ^^^^ help: consider using a `char`: `'"'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:75:31
--> tests/ui/single_char_pattern.rs:74:31
|
LL | x.replace(';', ",").split(","); // issue #2978
| ^^^ help: consider using a `char`: `','`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:78:19
--> tests/ui/single_char_pattern.rs:77:19
|
LL | x.starts_with("\x03"); // issue #2996
| ^^^^^^ help: consider using a `char`: `'\x03'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:87:13
--> tests/ui/single_char_pattern.rs:86:13
|
LL | x.split(r"a");
| ^^^^ help: consider using a `char`: `'a'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:89:13
--> tests/ui/single_char_pattern.rs:88:13
|
LL | x.split(r#"a"#);
| ^^^^^^ help: consider using a `char`: `'a'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:91:13
--> tests/ui/single_char_pattern.rs:90:13
|
LL | x.split(r###"a"###);
| ^^^^^^^^^^ help: consider using a `char`: `'a'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:93:13
--> tests/ui/single_char_pattern.rs:92:13
|
LL | x.split(r###"'"###);
| ^^^^^^^^^^ help: consider using a `char`: `'\''`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:95:13
--> tests/ui/single_char_pattern.rs:94:13
|
LL | x.split(r###"#"###);
| ^^^^^^^^^^ help: consider using a `char`: `'#'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:98:13
--> tests/ui/single_char_pattern.rs:97:13
|
LL | x.split(r#"\"#);
| ^^^^^^ help: consider using a `char`: `'\\'`

error: single-character string constant used as pattern
--> tests/ui/single_char_pattern.rs:100:13
--> tests/ui/single_char_pattern.rs:99:13
|
LL | x.split(r"\");
| ^^^^ help: consider using a `char`: `'\\'`
Expand Down
3 changes: 0 additions & 3 deletions tests/ui/single_component_path_imports.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![warn(clippy::single_component_path_imports)]
#![allow(unused_imports)]

use core;

Expand Down Expand Up @@ -31,13 +30,11 @@ fn main() {
mod hello_mod {

//~^ single_component_path_imports
#[allow(dead_code)]
fn hello_mod() {}
}

mod hi_mod {
use self::regex::{Regex, RegexSet};
use regex;
#[allow(dead_code)]
fn hi_mod() {}
}
3 changes: 0 additions & 3 deletions tests/ui/single_component_path_imports.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![warn(clippy::single_component_path_imports)]
#![allow(unused_imports)]

use core;

Expand Down Expand Up @@ -32,13 +31,11 @@ fn main() {
mod hello_mod {
use regex;
//~^ single_component_path_imports
#[allow(dead_code)]
fn hello_mod() {}
}

mod hi_mod {
use self::regex::{Regex, RegexSet};
use regex;
#[allow(dead_code)]
fn hi_mod() {}
}
4 changes: 2 additions & 2 deletions tests/ui/single_component_path_imports.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: this import is redundant
--> tests/ui/single_component_path_imports.rs:6:1
--> tests/ui/single_component_path_imports.rs:5:1
|
LL | use regex;
| ^^^^^^^^^^ help: remove it entirely
Expand All @@ -8,7 +8,7 @@ LL | use regex;
= help: to override `-D warnings` add `#[allow(clippy::single_component_path_imports)]`

error: this import is redundant
--> tests/ui/single_component_path_imports.rs:33:5
--> tests/ui/single_component_path_imports.rs:32:5
|
LL | use regex;
| ^^^^^^^^^^ help: remove it entirely
Expand Down
1 change: 0 additions & 1 deletion tests/ui/single_component_path_imports_macro.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ check-pass

#![warn(clippy::single_component_path_imports)]
#![allow(unused_imports)]

// #7106: use statements exporting a macro within a crate should not trigger lint
// #7923: normal `use` statements of macros should also not trigger the lint
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/single_component_path_imports_nested_first.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![warn(clippy::single_component_path_imports)]
#![allow(unused_imports)]
//@no-rustfix
use regex;
//~^ single_component_path_imports
Expand All @@ -18,6 +17,5 @@ mod root_nested_use_mod {
//~^ single_component_path_imports
//~| single_component_path_imports

#[allow(dead_code)]
fn root_nested_use_mod() {}
}
6 changes: 3 additions & 3 deletions tests/ui/single_component_path_imports_nested_first.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: this import is redundant
--> tests/ui/single_component_path_imports_nested_first.rs:4:1
--> tests/ui/single_component_path_imports_nested_first.rs:3:1
|
LL | use regex;
| ^^^^^^^^^^ help: remove it entirely
Expand All @@ -8,15 +8,15 @@ LL | use regex;
= help: to override `-D warnings` add `#[allow(clippy::single_component_path_imports)]`

error: this import is redundant
--> tests/ui/single_component_path_imports_nested_first.rs:17:10
--> tests/ui/single_component_path_imports_nested_first.rs:16:10
|
LL | use {regex, serde};
| ^^^^^
|
= help: remove this import

error: this import is redundant
--> tests/ui/single_component_path_imports_nested_first.rs:17:17
--> tests/ui/single_component_path_imports_nested_first.rs:16:17
|
LL | use {regex, serde};
| ^^^^^
Expand Down
1 change: 0 additions & 1 deletion tests/ui/single_component_path_imports_self_after.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ check-pass

#![warn(clippy::single_component_path_imports)]
#![allow(unused_imports)]

use self::regex::{Regex as xeger, RegexSet as tesxeger};
#[rustfmt::skip]
Expand Down
1 change: 0 additions & 1 deletion tests/ui/single_component_path_imports_self_before.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ check-pass

#![warn(clippy::single_component_path_imports)]
#![allow(unused_imports)]

use regex;

Expand Down
9 changes: 1 addition & 8 deletions tests/ui/single_match.fixed
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//@require-annotations-for-level: WARN
#![warn(clippy::single_match)]
#![allow(
unused,
clippy::uninlined_format_args,
clippy::needless_ifs,
clippy::redundant_guards,
clippy::redundant_pattern_matching,
clippy::manual_unwrap_or_default
)]
#![allow(clippy::redundant_pattern_matching)]
fn dummy() {}

fn single_match() {
Expand Down
Loading