1
1
error: 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
3
3
|
4
4
LL | fs::write(Path::new("foo.txt"), "foo");
5
5
| ^^^^^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo.txt"`
@@ -8,22 +8,34 @@ LL | fs::write(Path::new("foo.txt"), "foo");
8
8
= help: to override `-D warnings` add `#[allow(clippy::needless_path_new)]`
9
9
10
10
error: 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
12
12
|
13
13
LL | Path::new("foo"),
14
14
| ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo"`
15
15
16
16
error: 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
18
18
|
19
19
LL | Path::new("bar"),
20
20
| ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
21
21
22
22
error: 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
24
24
|
25
25
LL | Path::new("bar"),
26
26
| ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
27
27
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
29
41
0 commit comments