Skip to content

Commit bc8ad6a

Browse files
authored
Bring documentation of Path::to_path_buf in line with the rest of Path/PathBuf
Changes the example from using the qualified path of PathBuf with an import. This is what's done in all other Path/PathBuf examples and makes the code look a bit cleaner.
1 parent b14d8b2 commit bc8ad6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,10 +2143,10 @@ impl Path {
21432143
/// # Examples
21442144
///
21452145
/// ```
2146-
/// use std::path::Path;
2146+
/// use std::path::{Path, PathBuf};
21472147
///
21482148
/// let path_buf = Path::new("foo.txt").to_path_buf();
2149-
/// assert_eq!(path_buf, std::path::PathBuf::from("foo.txt"));
2149+
/// assert_eq!(path_buf, PathBuf::from("foo.txt"));
21502150
/// ```
21512151
#[rustc_conversion_suggestion]
21522152
#[must_use = "this returns the result of the operation, \

0 commit comments

Comments
 (0)