We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4eead5 commit 88e242eCopy full SHA for 88e242e
tests/ui/pathbuf_init_then_push.rs
@@ -3,17 +3,17 @@
3
use std::path::PathBuf;
4
5
fn main() {
6
- let mut path_buf = PathBuf::new();
+ let mut path_buf = PathBuf::new(); //~ ERROR: calls to `push` immediately after creation
7
path_buf.push("foo");
8
9
- path_buf = PathBuf::from("foo");
+ path_buf = PathBuf::from("foo"); //~ ERROR: calls to `push` immediately after creation
10
path_buf.push("bar");
11
12
let bar = "bar";
13
14
path_buf.push(bar);
15
16
- let mut path_buf = PathBuf::from("foo").join("bar");
+ let mut path_buf = PathBuf::from("foo").join("bar"); //~ ERROR: calls to `push` immediately after creation
17
path_buf.push("buz");
18
19
let mut x = PathBuf::new();
0 commit comments