@@ -7,20 +7,26 @@ LL | fs::write(Path::new("foo.txt"), "foo");
77 = note: `-D clippy::needless-path-new` implied by `-D warnings`
88 = help: to override `-D warnings` add `#[allow(clippy::needless_path_new)]`
99
10+ error: the expression enclosed in `Path::new` implements `AsRef<Path>`
11+ --> tests/ui/needless_path_new.rs:31:9
12+ |
13+ LL | Path::new("bar"),
14+ | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
15+
1016error: the expression enclosed in `Path::new` implements `AsRef<Path>`
1117 --> tests/ui/needless_path_new.rs:30:9
1218 |
1319LL | Path::new("foo"),
1420 | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo"`
1521
1622error: the expression enclosed in `Path::new` implements `AsRef<Path>`
17- --> tests/ui/needless_path_new.rs:31 :9
23+ --> tests/ui/needless_path_new.rs:38 :9
1824 |
1925LL | Path::new("bar"),
2026 | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
2127
2228error: the expression enclosed in `Path::new` implements `AsRef<Path>`
23- --> tests/ui/needless_path_new.rs:38 :9
29+ --> tests/ui/needless_path_new.rs:44 :9
2430 |
2531LL | Path::new("bar"),
2632 | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
@@ -32,10 +38,10 @@ LL | Path::new("foo"),
3238 | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo"`
3339
3440error: the expression enclosed in `Path::new` implements `AsRef<Path>`
35- --> tests/ui/needless_path_new.rs:44:9
41+ --> tests/ui/needless_path_new.rs:49:7
3642 |
37- LL | Path::new("bar"),
38- | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar "`
43+ LL | a( Path::new("foo.txt"));
44+ | ^^^^^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo.txt "`
3945
40- error: aborting due to 6 previous errors
46+ error: aborting due to 7 previous errors
4147
0 commit comments