Skip to content

Commit

Permalink
Update style of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastian Gruber committed Nov 21, 2018
1 parent 88a708d commit 5c747eb
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions src/libstd/path.rs
Expand Up @@ -1397,7 +1397,8 @@ impl<'a> From<&'a Path> for Box<Path> {

#[stable(feature = "path_buf_from_box", since = "1.18.0")]
impl From<Box<Path>> for PathBuf {
/// Converts a `Box<Path>` into a `PathBuf`.
/// Converts a `Box<Path>` into a `PathBuf`
///
/// This conversion does not allocate memory
fn from(boxed: Box<Path>) -> PathBuf {
boxed.into_path_buf()
Expand All @@ -1406,7 +1407,8 @@ impl From<Box<Path>> for PathBuf {

#[stable(feature = "box_from_path_buf", since = "1.20.0")]
impl From<PathBuf> for Box<Path> {
/// Converts a `PathBuf` into a `Box<Path>`.
/// Converts a `PathBuf` into a `Box<Path>`
///
/// This conversion does not allocate memory
fn from(p: PathBuf) -> Box<Path> {
p.into_boxed_path()
Expand All @@ -1430,7 +1432,8 @@ impl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for PathBuf {

#[stable(feature = "rust1", since = "1.0.0")]
impl From<OsString> for PathBuf {
/// Converts a `OsString` into a `PathBuf`.
/// Converts a `OsString` into a `PathBuf`
///
/// This conversion does not allocate memory
fn from(s: OsString) -> PathBuf {
PathBuf { inner: s }
Expand All @@ -1439,7 +1442,8 @@ impl From<OsString> for PathBuf {

#[stable(feature = "from_path_buf_for_os_string", since = "1.14.0")]
impl From<PathBuf> for OsString {
/// Converts a `PathBuf` into a `OsString`.
/// Converts a `PathBuf` into a `OsString`
///
/// This conversion does not allocate memory
fn from(path_buf : PathBuf) -> OsString {
path_buf.inner
Expand All @@ -1448,7 +1452,8 @@ impl From<PathBuf> for OsString {

#[stable(feature = "rust1", since = "1.0.0")]
impl From<String> for PathBuf {
/// Converts a `String` into a `PathBuf`.
/// Converts a `String` into a `PathBuf`
///
/// This conversion does not allocate memory
fn from(s: String) -> PathBuf {
PathBuf::from(OsString::from(s))
Expand Down Expand Up @@ -1546,9 +1551,11 @@ 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 `PathBuf` into a `Arc<Path>`
///
/// This conversion happens in place
///
/// This conversion does not allocate memory
#[inline]
fn from(s: PathBuf) -> Arc<Path> {
let arc: Arc<OsStr> = Arc::from(s.into_os_string());
Expand All @@ -1558,9 +1565,12 @@ 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 `PathBuf` into a `Arc<Path>`
///
/// This conversion happens in place
///
/// This conversion does not allocate memory
///
#[inline]
fn from(s: &Path) -> Arc<Path> {
let arc: Arc<OsStr> = Arc::from(s.as_os_str());
Expand All @@ -1570,9 +1580,11 @@ 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 `PathBuf` into a `Rc<Path>`
///
/// This conversion happens in place
///
/// This conversion does not allocate memory
#[inline]
fn from(s: PathBuf) -> Rc<Path> {
let rc: Rc<OsStr> = Rc::from(s.into_os_string());
Expand Down

0 comments on commit 5c747eb

Please sign in to comment.