diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 56ea51226f9..ba86b73f3a8 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2143,10 +2143,10 @@ pub fn to_string_lossy(&self) -> Cow<'_, str> { /// # Examples /// /// ``` - /// use std::path::Path; + /// use std::path::{Path, PathBuf}; /// /// let path_buf = Path::new("foo.txt").to_path_buf(); - /// assert_eq!(path_buf, std::path::PathBuf::from("foo.txt")); + /// assert_eq!(path_buf, PathBuf::from("foo.txt")); /// ``` #[rustc_conversion_suggestion] #[must_use = "this returns the result of the operation, \