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 40a91c2 commit 8368b37Copy full SHA for 8368b37
clippy_lints/src/pathbuf_init_then_push.rs
@@ -26,13 +26,15 @@ declare_clippy_lint! {
26
///
27
/// ### Example
28
/// ```rust
29
- /// use std::path::PathBuf;
+ /// # use std::path::PathBuf;
30
/// let mut path_buf = PathBuf::new();
31
/// path_buf.push("foo");
32
/// ```
33
/// Use instead:
34
35
36
+ /// let path_buf = PathBuf::from("foo");
37
+ /// // or
38
/// let path_buf = PathBuf::new().join("foo");
39
40
#[clippy::version = "1.78.0"]
0 commit comments