diff options
| author | Bastian Gruber <gruberbastian@me.com> | 2018-11-21 13:06:22 +0100 |
|---|---|---|
| committer | Bastian Gruber <gruberbastian@me.com> | 2018-11-21 13:06:22 +0100 |
| commit | e8dafbaf10bf9e54854382f0aa830d219aec85bb (patch) | |
| tree | 63870adabdef1b222efdc5d6bad695d9cd427805 /src/libstd | |
| parent | 5c747eb32654401b9b6fe053c3f51399a6454f8c (diff) | |
| download | rust-e8dafbaf10bf9e54854382f0aa830d219aec85bb.tar.gz rust-e8dafbaf10bf9e54854382f0aa830d219aec85bb.zip | |
Adjust doc comments
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path.rs | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 9f6fcad2422..2d0a2501f7e 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1399,7 +1399,7 @@ impl<'a> From<&'a Path> for Box<Path> { impl From<Box<Path>> for PathBuf { /// Converts a `Box<Path>` into a `PathBuf` /// - /// This conversion does not allocate memory + /// This conversion does not allocate or copy memory. fn from(boxed: Box<Path>) -> PathBuf { boxed.into_path_buf() } @@ -1409,7 +1409,8 @@ impl From<Box<Path>> for PathBuf { impl From<PathBuf> for Box<Path> { /// Converts a `PathBuf` into a `Box<Path>` /// - /// This conversion does not allocate memory + /// This conversion currently should not allocate memory, + // but this behavior is not guaranteed on all platforms or in all future versions. fn from(p: PathBuf) -> Box<Path> { p.into_boxed_path() } @@ -1434,7 +1435,7 @@ impl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for PathBuf { impl From<OsString> for PathBuf { /// Converts a `OsString` into a `PathBuf` /// - /// This conversion does not allocate memory + /// This conversion does not allocate or copy memory. fn from(s: OsString) -> PathBuf { PathBuf { inner: s } } @@ -1444,7 +1445,7 @@ impl From<OsString> for PathBuf { impl From<PathBuf> for OsString { /// Converts a `PathBuf` into a `OsString` /// - /// This conversion does not allocate memory + /// This conversion does not allocate or copy memory. fn from(path_buf : PathBuf) -> OsString { path_buf.inner } @@ -1454,7 +1455,7 @@ impl From<PathBuf> for OsString { impl From<String> for PathBuf { /// Converts a `String` into a `PathBuf` /// - /// This conversion does not allocate memory + /// This conversion does not allocate or copy memory. fn from(s: String) -> PathBuf { PathBuf::from(OsString::from(s)) } @@ -1551,11 +1552,7 @@ impl<'a> From<Cow<'a, Path>> for PathBuf { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From<PathBuf> for Arc<Path> { - /// Converts a `PathBuf` into a `Arc<Path>` - /// - /// This conversion happens in place - /// - /// This conversion does not allocate memory + /// Converts a Path into a Rc by copying the Path data into a new Rc buffer. #[inline] fn from(s: PathBuf) -> Arc<Path> { let arc: Arc<OsStr> = Arc::from(s.into_os_string()); @@ -1565,12 +1562,7 @@ impl From<PathBuf> for Arc<Path> { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl<'a> From<&'a Path> for Arc<Path> { - /// Converts a `PathBuf` into a `Arc<Path>` - /// - /// This conversion happens in place - /// - /// This conversion does not allocate memory - /// + /// Converts a Path into a Rc by copying the Path data into a new Rc buffer. #[inline] fn from(s: &Path) -> Arc<Path> { let arc: Arc<OsStr> = Arc::from(s.as_os_str()); @@ -1580,11 +1572,7 @@ impl<'a> From<&'a Path> for Arc<Path> { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From<PathBuf> for Rc<Path> { - /// Converts a `PathBuf` into a `Rc<Path>` - /// - /// This conversion happens in place - /// - /// This conversion does not allocate memory + /// Converts a Path into a Rc by copying the Path data into a new Rc buffer. #[inline] fn from(s: PathBuf) -> Rc<Path> { let rc: Rc<OsStr> = Rc::from(s.into_os_string()); @@ -1594,6 +1582,7 @@ impl From<PathBuf> for Rc<Path> { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl<'a> From<&'a Path> for Rc<Path> { + /// Converts a Path into a Rc by copying the Path data into a new Rc buffer. #[inline] fn from(s: &Path) -> Rc<Path> { let rc: Rc<OsStr> = Rc::from(s.as_os_str()); |
