about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKriskras99 <github@kriskras99.nl>2024-04-10 13:21:26 +0200
committerGitHub <noreply@github.com>2024-04-10 13:21:26 +0200
commitbc8ad6a41eb8ba30787cfae159f8d778fcb5b2e7 (patch)
tree8bcab194fcf544fec80b918c7fa9eac82ba14d00
parentb14d8b2ef20c64c1002e2c6c724025c3d0846b91 (diff)
downloadrust-bc8ad6a41eb8ba30787cfae159f8d778fcb5b2e7.tar.gz
rust-bc8ad6a41eb8ba30787cfae159f8d778fcb5b2e7.zip
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.
-rw-r--r--library/std/src/path.rs4
1 files changed, 2 insertions, 2 deletions
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 @@ impl Path {
     /// # 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, \