mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
add example of joining with a absolute path
This commit is contained in:
@@ -2541,6 +2541,7 @@ pub fn extension(&self) -> Option<&OsStr> {
|
||||
/// use std::path::{Path, PathBuf};
|
||||
///
|
||||
/// assert_eq!(Path::new("/etc").join("passwd"), PathBuf::from("/etc/passwd"));
|
||||
/// assert_eq!(Path::new("/etc").join("/bin/sh"), PathBuf::from("/bin/sh"));
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[must_use]
|
||||
|
||||
Reference in New Issue
Block a user