We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83b70c2 commit 9577561Copy full SHA for 9577561
src/libstd/path.rs
@@ -1240,6 +1240,13 @@ impl Path {
1240
/// use std::path::Path;
1241
///
1242
/// Path::new("foo.txt");
1243
+ ///
1244
+ /// // Strings work too
1245
+ /// let s = String::from("bar.txt");
1246
+ /// let p = Path::new(&s);
1247
1248
+ /// // As do other Paths
1249
+ /// Path::new(&p);
1250
/// ```
1251
#[stable(feature = "rust1", since = "1.0.0")]
1252
pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &Path {
0 commit comments