File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -2236,7 +2236,26 @@ impl fmt::Debug for Path {
2236
2236
}
2237
2237
}
2238
2238
2239
- /// Helper struct for safely printing paths with `format!()` and `{}`
2239
+ /// Helper struct for safely printing paths with [`format!`] and `{}`.
2240
+ ///
2241
+ /// A [`Path`] might contain non-Unicode data. This `struct` implements the
2242
+ /// [`Display`] trait in a way that mitigates that. It is created by the
2243
+ /// [`display`][`Path::display`] method on [`Path`].
2244
+ ///
2245
+ /// # Examples
2246
+ ///
2247
+ /// ```
2248
+ /// use std::path::Path;
2249
+ ///
2250
+ /// let path = Path::new("/tmp/foo.rs");
2251
+ ///
2252
+ /// println!("{}", path.display());
2253
+ /// ```
2254
+ ///
2255
+ /// [`Display`]: ../../std/fmt/trait.Display.html
2256
+ /// [`format!`]: ../../std/macro.format.html
2257
+ /// [`Path`]: struct.Path.html
2258
+ /// [`Path::display`]: struct.Path.html#method.display
2240
2259
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2241
2260
pub struct Display < ' a > {
2242
2261
path : & ' a Path ,
You can’t perform that action at this time.
0 commit comments