|
1 | 1 | error: `format!(..)` used to form `PathBuf`
|
2 |
| - --> $DIR/path_from_format.rs:7:5 |
| 2 | + --> $DIR/path_from_format.rs:8:5 |
3 | 3 | |
|
4 | 4 | LL | PathBuf::from(format!("{}/foo/bar", base_path1));
|
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.join()` to avoid the extra allocation: `Path::new(base_path1).join("foo/bar")` |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | 6 | |
|
7 | 7 | = note: `-D clippy::path-from-format` implied by `-D warnings`
|
| 8 | +help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 9 | + | |
| 10 | +LL | Path::new(base_path1).join("foo").join("bar"); |
| 11 | + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
8 | 12 |
|
9 | 13 | error: `format!(..)` used to form `PathBuf`
|
10 |
| - --> $DIR/path_from_format.rs:8:5 |
| 14 | + --> $DIR/path_from_format.rs:9:5 |
11 | 15 | |
|
12 | 16 | LL | PathBuf::from(format!("/foo/bar/{}", base_path1));
|
13 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.join()` to avoid the extra allocation: `Path::new("/foo/bar/").join(base_path1)` |
| 17 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 18 | + | |
| 19 | +help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 20 | + | |
| 21 | +LL | Path::new("/").join("foo").join("bar").join(base_path1); |
| 22 | + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
14 | 23 |
|
15 | 24 | error: `format!(..)` used to form `PathBuf`
|
16 |
| - --> $DIR/path_from_format.rs:9:5 |
| 25 | + --> $DIR/path_from_format.rs:10:5 |
17 | 26 | |
|
18 | 27 | LL | PathBuf::from(format!("/foo/{}/bar", base_path1));
|
19 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.join()` to avoid the extra allocation: `Path::new("/foo/").join(base_path1).join("bar")` |
| 28 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 29 | + | |
| 30 | +help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 31 | + | |
| 32 | +LL | Path::new("/").join("foo").join(base_path1).join("bar"); |
| 33 | + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
20 | 34 |
|
21 | 35 | error: `format!(..)` used to form `PathBuf`
|
22 |
| - --> $DIR/path_from_format.rs:10:5 |
| 36 | + --> $DIR/path_from_format.rs:11:5 |
23 | 37 | |
|
24 | 38 | LL | PathBuf::from(format!("foo/{}/bar", base_path1));
|
25 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.join()` to avoid the extra allocation: `Path::new("foo/").join(base_path1).join("bar")` |
| 39 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 40 | + | |
| 41 | +help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 42 | + | |
| 43 | +LL | Path::new("foo").join(base_path1).join("bar"); |
| 44 | + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
26 | 45 |
|
27 | 46 | error: `format!(..)` used to form `PathBuf`
|
28 |
| - --> $DIR/path_from_format.rs:11:5 |
| 47 | + --> $DIR/path_from_format.rs:12:5 |
| 48 | + | |
| 49 | +LL | PathBuf::from(format!("foo/foooo/{base_path1}/bar/barrr")); |
| 50 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 51 | + | |
| 52 | +help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 53 | + | |
| 54 | +LL | Path::new("foo").join("foooo").join(base_path1).join("bar").join("barrr"); |
| 55 | + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 56 | + |
| 57 | +error: `format!(..)` used to form `PathBuf` |
| 58 | + --> $DIR/path_from_format.rs:13:5 |
| 59 | + | |
| 60 | +LL | PathBuf::from(format!("foo/foooo/{base_path1}/bar/barrr")); |
| 61 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 62 | + | |
| 63 | +help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 64 | + | |
| 65 | +LL | Path::new("foo").join("foooo").join(base_path1).join("bar").join("barrr"); |
| 66 | + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 67 | + |
| 68 | +error: `format!(..)` used to form `PathBuf` |
| 69 | + --> $DIR/path_from_format.rs:14:5 |
| 70 | + | |
| 71 | +LL | PathBuf::from(format!("foo/foooo/{base_path1}/bar/barrr/{base_path2}")); |
| 72 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 73 | + | |
| 74 | +help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 75 | + | |
| 76 | +LL | Path::new("foo").join("foooo").join(base_path1).join("bar").join("barrr").join(base_path2); |
| 77 | + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 78 | + |
| 79 | +error: `format!(..)` used to form `PathBuf` |
| 80 | + --> $DIR/path_from_format.rs:15:5 |
| 81 | + | |
| 82 | +LL | PathBuf::from(format!("{base_path2}/foo/{base_path1}/bar")); |
| 83 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 84 | + | |
| 85 | +help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 86 | + | |
| 87 | +LL | Path::new(base_path2).join("foo").join(base_path1).join("bar"); |
| 88 | + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 89 | + |
| 90 | +error: `format!(..)` used to form `PathBuf` |
| 91 | + --> $DIR/path_from_format.rs:16:5 |
| 92 | + | |
| 93 | +LL | PathBuf::from(format!("foo/{base_path1}a/bar")); |
| 94 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 95 | + | |
| 96 | + = note: if it fits your use case, you may want to consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
| 97 | + |
| 98 | +error: `format!(..)` used to form `PathBuf` |
| 99 | + --> $DIR/path_from_format.rs:17:5 |
| 100 | + | |
| 101 | +LL | PathBuf::from(format!("foo/a{base_path1}/bar")); |
| 102 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
29 | 103 | |
|
30 |
| -LL | PathBuf::from(format!("foo/{base_path1}/bar")); |
31 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.join()` to avoid the extra allocation: `Path::new("foo/").join(base_path1).join("bar")` |
| 104 | + = note: if it fits your use case, you may want to consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability. |
32 | 105 |
|
33 |
| -error: aborting due to 5 previous errors |
| 106 | +error: aborting due to 10 previous errors |
34 | 107 |
|
0 commit comments