rust/tests/ui/pathbuf_init_then_push.stderr
2024-07-21 14:22:48 +08:00

34 lines
1.4 KiB
Plaintext

error: calls to `push` immediately after creation
--> tests/ui/pathbuf_init_then_push.rs:6:5
|
LL | / let mut path_buf = PathBuf::new();
LL | | path_buf.push("foo");
| |_________________________^ help: consider using the `.join()`: `let mut path_buf = PathBuf::from("foo");`
|
= note: `-D clippy::pathbuf-init-then-push` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::pathbuf_init_then_push)]`
error: calls to `push` immediately after creation
--> tests/ui/pathbuf_init_then_push.rs:9:5
|
LL | / path_buf = PathBuf::from("foo");
LL | | path_buf.push("bar");
| |_________________________^ help: consider using the `.join()`: `path_buf = PathBuf::from("foo").join("bar");`
error: calls to `push` immediately after creation
--> tests/ui/pathbuf_init_then_push.rs:13:5
|
LL | / path_buf = PathBuf::from("foo");
LL | | path_buf.push(bar);
| |_______________________^ help: consider using the `.join()`: `path_buf = PathBuf::from("foo").join(bar);`
error: calls to `push` immediately after creation
--> tests/ui/pathbuf_init_then_push.rs:16:5
|
LL | / let mut path_buf = PathBuf::from("foo").join("bar");
LL | | path_buf.push("buz");
| |_________________________^ help: consider using the `.join()`: `let mut path_buf = PathBuf::from("foo").join("bar").join("buz");`
error: aborting due to 4 previous errors