Skip to content

Commit 8368b37

Browse files
lengyijunxFrednet
andauthored
Update clippy_lints/src/pathbuf_init_then_push.rs
Co-authored-by: Fridtjof Stoldt <[email protected]>
1 parent 40a91c2 commit 8368b37

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clippy_lints/src/pathbuf_init_then_push.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ declare_clippy_lint! {
2626
///
2727
/// ### Example
2828
/// ```rust
29-
/// use std::path::PathBuf;
29+
/// # use std::path::PathBuf;
3030
/// let mut path_buf = PathBuf::new();
3131
/// path_buf.push("foo");
3232
/// ```
3333
/// Use instead:
3434
/// ```rust
35-
/// use std::path::PathBuf;
35+
/// # use std::path::PathBuf;
36+
/// let path_buf = PathBuf::from("foo");
37+
/// // or
3638
/// let path_buf = PathBuf::new().join("foo");
3739
/// ```
3840
#[clippy::version = "1.78.0"]

0 commit comments

Comments
 (0)