11error: the expression enclosed in `Path::new` implements `AsRef<Path>`
2- --> tests/ui/needless_path_new.rs:22 :15
2+ --> tests/ui/needless_path_new.rs:24 :15
33 |
44LL | fs::write(Path::new("foo.txt"), "foo");
55 | ^^^^^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo.txt"`
@@ -8,22 +8,34 @@ LL | fs::write(Path::new("foo.txt"), "foo");
88 = help: to override `-D warnings` add `#[allow(clippy::needless_path_new)]`
99
1010error: the expression enclosed in `Path::new` implements `AsRef<Path>`
11- --> tests/ui/needless_path_new.rs:25 :9
11+ --> tests/ui/needless_path_new.rs:27 :9
1212 |
1313LL | Path::new("foo"),
1414 | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo"`
1515
1616error: the expression enclosed in `Path::new` implements `AsRef<Path>`
17- --> tests/ui/needless_path_new.rs:26 :9
17+ --> tests/ui/needless_path_new.rs:28 :9
1818 |
1919LL | Path::new("bar"),
2020 | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
2121
2222error: the expression enclosed in `Path::new` implements `AsRef<Path>`
23- --> tests/ui/needless_path_new.rs:33 :9
23+ --> tests/ui/needless_path_new.rs:35 :9
2424 |
2525LL | Path::new("bar"),
2626 | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
2727
28- error: aborting due to 4 previous errors
28+ error: the expression enclosed in `Path::new` implements `AsRef<Path>`
29+ --> tests/ui/needless_path_new.rs:40:9
30+ |
31+ LL | Path::new("foo"),
32+ | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo"`
33+
34+ error: the expression enclosed in `Path::new` implements `AsRef<Path>`
35+ --> tests/ui/needless_path_new.rs:41:9
36+ |
37+ LL | Path::new("bar"),
38+ | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
39+
40+ error: aborting due to 6 previous errors
2941
0 commit comments