11error: `format!(..)` used to form `PathBuf`
22 --> $DIR/paths_from_format.rs:8:5
33 |
4- LL | PathBuf::from(format!("{}/foo/bar", base_path1 ));
5- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+ LL | PathBuf::from(format!("{base_path1 }/foo/bar"));
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
77 = note: `-D clippy::paths-from-format` implied by `-D warnings`
88help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability
@@ -13,8 +13,8 @@ LL | Path::new(&base_path1).join("foo").join("bar");
1313error: `format!(..)` used to form `PathBuf`
1414 --> $DIR/paths_from_format.rs:9:5
1515 |
16- LL | PathBuf::from(format!("/foo/bar/{}", base_path1 ));
17- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16+ LL | PathBuf::from(format!("/foo/bar/{base_path1}" ));
17+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818 |
1919help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability
2020 |
@@ -24,8 +24,8 @@ LL | Path::new("/").join("foo").join("bar").join(&base_path1);
2424error: `format!(..)` used to form `PathBuf`
2525 --> $DIR/paths_from_format.rs:10:5
2626 |
27- LL | PathBuf::from(format!("/foo/{}/bar", base_path1 ));
28- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27+ LL | PathBuf::from(format!("/foo/{base_path1 }/bar"));
28+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2929 |
3030help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability
3131 |
@@ -35,8 +35,8 @@ LL | Path::new("/").join("foo").join(&base_path1).join("bar");
3535error: `format!(..)` used to form `PathBuf`
3636 --> $DIR/paths_from_format.rs:11:5
3737 |
38- LL | PathBuf::from(format!("foo/{}/bar", base_path1 ));
39- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38+ LL | PathBuf::from(format!("foo/{base_path1 }/bar"));
39+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4040 |
4141help: consider using `Path::new()` and `.join()` to make it OS-agnostic and improve code readability
4242 |
0 commit comments