Skip to content

Commit

Permalink
bless clippy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Jun 16, 2022
1 parent bd071bf commit 922ff84
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 70 deletions.
16 changes: 8 additions & 8 deletions tests/ui/eprint_with_newline.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ help: use `eprintln!` instead
|
LL - eprint!("Hello/n");
LL + eprintln!("Hello");
|
|

error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:6:5
Expand All @@ -21,7 +21,7 @@ help: use `eprintln!` instead
|
LL - eprint!("Hello {}/n", "world");
LL + eprintln!("Hello {}", "world");
|
|

error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:7:5
Expand All @@ -33,7 +33,7 @@ help: use `eprintln!` instead
|
LL - eprint!("Hello {} {}/n", "world", "#2");
LL + eprintln!("Hello {} {}", "world", "#2");
|
|

error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:8:5
Expand All @@ -45,7 +45,7 @@ help: use `eprintln!` instead
|
LL - eprint!("{}/n", 1265);
LL + eprintln!("{}", 1265);
|
|

error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:9:5
Expand All @@ -57,7 +57,7 @@ help: use `eprintln!` instead
|
LL - eprint!("/n");
LL + eprintln!();
|
|

error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:28:5
Expand All @@ -69,7 +69,7 @@ help: use `eprintln!` instead
|
LL - eprint!("//n"); // should fail
LL + eprintln!("/"); // should fail
|
|

error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:35:5
Expand Down Expand Up @@ -111,7 +111,7 @@ help: use `eprintln!` instead
|
LL - eprint!("/r/n"); //~ ERROR
LL + eprintln!("/r"); //~ ERROR
|
|

error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:48:5
Expand All @@ -123,7 +123,7 @@ help: use `eprintln!` instead
|
LL - eprint!("foo/rbar/n") // ~ ERROR
LL + eprintln!("foo/rbar") // ~ ERROR
|
|

error: aborting due to 10 previous errors

20 changes: 10 additions & 10 deletions tests/ui/manual_split_once.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ help: remove the `iter` usages
|
LL - let l = iter.next().unwrap();
LL +
|
|
help: remove the `iter` usages
|
LL - let r = iter.next().unwrap();
LL +
|
|

error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:49:5
Expand All @@ -121,12 +121,12 @@ help: remove the `iter` usages
|
LL - let l = iter.next()?;
LL +
|
|
help: remove the `iter` usages
|
LL - let r = iter.next()?;
LL +
|
|

error: manual implementation of `rsplit_once`
--> $DIR/manual_split_once.rs:53:5
Expand All @@ -146,12 +146,12 @@ help: remove the `iter` usages
|
LL - let r = iter.next().unwrap();
LL +
|
|
help: remove the `iter` usages
|
LL - let l = iter.next().unwrap();
LL +
|
|

error: manual implementation of `rsplit_once`
--> $DIR/manual_split_once.rs:57:5
Expand All @@ -171,12 +171,12 @@ help: remove the `iter` usages
|
LL - let r = iter.next()?;
LL +
|
|
help: remove the `iter` usages
|
LL - let l = iter.next()?;
LL +
|
|

error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:142:13
Expand All @@ -202,12 +202,12 @@ help: remove the `iter` usages
|
LL - let a = iter.next().unwrap();
LL +
|
|
help: remove the `iter` usages
|
LL - let b = iter.next().unwrap();
LL +
|
|

error: aborting due to 19 previous errors

8 changes: 4 additions & 4 deletions tests/ui/map_unwrap_or.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ help: use `map_or(<a>, <f>)` instead
|
LL - let _ = opt.map(|x| x + 1)
LL + let _ = opt.map_or(0, |x| x + 1);
|
|

error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
--> $DIR/map_unwrap_or.rs:20:13
Expand Down Expand Up @@ -59,7 +59,7 @@ help: use `and_then(<f>)` instead
|
LL - let _ = opt.map(|x| Some(x + 1)).unwrap_or(None);
LL + let _ = opt.and_then(|x| Some(x + 1));
|
|

error: called `map(<f>).unwrap_or(None)` on an `Option` value. This can be done more directly by calling `and_then(<f>)` instead
--> $DIR/map_unwrap_or.rs:31:13
Expand Down Expand Up @@ -92,7 +92,7 @@ help: use `and_then(<f>)` instead
|
LL - .map(|x| Some(x + 1))
LL + .and_then(|x| Some(x + 1));
|
|

error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
--> $DIR/map_unwrap_or.rs:46:13
Expand All @@ -104,7 +104,7 @@ help: use `map_or(<a>, <f>)` instead
|
LL - let _ = Some("prefix").map(|p| format!("{}.", p)).unwrap_or(id);
LL + let _ = Some("prefix").map_or(id, |p| format!("{}.", p));
|
|

error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value. This can be done more directly by calling `map_or_else(<g>, <f>)` instead
--> $DIR/map_unwrap_or.rs:50:13
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/needless_late_init.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ help: remove the assignments from the `match` arms
|
LL - 1 => f = "three",
LL + 1 => "three",
|
|

error: unneeded late initialization
--> $DIR/needless_late_init.rs:76:5
Expand All @@ -180,7 +180,7 @@ help: remove the assignments from the branches
|
LL - g = 5;
LL + 5
|
|
help: add a semicolon after the `if` expression
|
LL | };
Expand Down
22 changes: 11 additions & 11 deletions tests/ui/print_literal.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ help: try this
|
LL - print!("Hello {}", "world");
LL + print!("Hello world");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:26:36
Expand All @@ -21,7 +21,7 @@ help: try this
|
LL - println!("Hello {} {}", world, "world");
LL + println!("Hello {} world", world);
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:27:26
Expand All @@ -33,7 +33,7 @@ help: try this
|
LL - println!("Hello {}", "world");
LL + println!("Hello world");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:32:25
Expand All @@ -45,7 +45,7 @@ help: try this
|
LL - println!("{0} {1}", "hello", "world");
LL + println!("hello {1}", "world");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:32:34
Expand All @@ -57,7 +57,7 @@ help: try this
|
LL - println!("{0} {1}", "hello", "world");
LL + println!("{0} world", "hello");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:33:25
Expand All @@ -69,7 +69,7 @@ help: try this
|
LL - println!("{1} {0}", "hello", "world");
LL + println!("{1} hello", "world");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:33:34
Expand All @@ -81,7 +81,7 @@ help: try this
|
LL - println!("{1} {0}", "hello", "world");
LL + println!("world {0}", "hello");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:36:29
Expand All @@ -93,7 +93,7 @@ help: try this
|
LL - println!("{foo} {bar}", foo = "hello", bar = "world");
LL + println!("hello {bar}", bar = "world");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:36:44
Expand All @@ -105,7 +105,7 @@ help: try this
|
LL - println!("{foo} {bar}", foo = "hello", bar = "world");
LL + println!("{foo} world", foo = "hello");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:37:29
Expand All @@ -117,7 +117,7 @@ help: try this
|
LL - println!("{bar} {foo}", foo = "hello", bar = "world");
LL + println!("{bar} hello", bar = "world");
|
|

error: literal with an empty format string
--> $DIR/print_literal.rs:37:44
Expand All @@ -129,7 +129,7 @@ help: try this
|
LL - println!("{bar} {foo}", foo = "hello", bar = "world");
LL + println!("world {foo}", foo = "hello");
|
|

error: aborting due to 11 previous errors

16 changes: 8 additions & 8 deletions tests/ui/print_with_newline.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ help: use `println!` instead
|
LL - print!("Hello/n");
LL + println!("Hello");
|
|

error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:9:5
Expand All @@ -21,7 +21,7 @@ help: use `println!` instead
|
LL - print!("Hello {}/n", "world");
LL + println!("Hello {}", "world");
|
|

error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:10:5
Expand All @@ -33,7 +33,7 @@ help: use `println!` instead
|
LL - print!("Hello {} {}/n", "world", "#2");
LL + println!("Hello {} {}", "world", "#2");
|
|

error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:11:5
Expand All @@ -45,7 +45,7 @@ help: use `println!` instead
|
LL - print!("{}/n", 1265);
LL + println!("{}", 1265);
|
|

error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:12:5
Expand All @@ -57,7 +57,7 @@ help: use `println!` instead
|
LL - print!("/n");
LL + println!();
|
|

error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:31:5
Expand All @@ -69,7 +69,7 @@ help: use `println!` instead
|
LL - print!("//n"); // should fail
LL + println!("/"); // should fail
|
|

error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:38:5
Expand Down Expand Up @@ -111,7 +111,7 @@ help: use `println!` instead
|
LL - print!("/r/n"); //~ ERROR
LL + println!("/r"); //~ ERROR
|
|

error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:51:5
Expand All @@ -123,7 +123,7 @@ help: use `println!` instead
|
LL - print!("foo/rbar/n") // ~ ERROR
LL + println!("foo/rbar") // ~ ERROR
|
|

error: aborting due to 10 previous errors

4 changes: 2 additions & 2 deletions tests/ui/unnecessary_iter_cloned.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ help: remove this `&`
|
LL - let other = match get_file_path(&t) {
LL + let other = match get_file_path(t) {
|
|

error: unnecessary use of `copied`
--> $DIR/unnecessary_iter_cloned.rs:46:22
Expand All @@ -29,7 +29,7 @@ help: remove this `&`
|
LL - let other = match get_file_path(&t) {
LL + let other = match get_file_path(t) {
|
|

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion tests/ui/unnecessary_to_owned.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ help: remove this `&`
|
LL - let path = match get_file_path(&t) {
LL + let path = match get_file_path(t) {
|
|

error: unnecessary use of `to_vec`
--> $DIR/unnecessary_to_owned.rs:221:14
Expand Down
Loading

0 comments on commit 922ff84

Please sign in to comment.