Auto merge of #28030 - tshepang:improve-example, r=alexcrichton
This commit is contained in:
commit
b28f0b1887
@ -632,9 +632,11 @@ fn is_sep_byte(&self, b: u8) -> bool {
|
||||
/// ```
|
||||
/// use std::path::Path;
|
||||
///
|
||||
/// let path = Path::new("/tmp/foo/bar.txt");
|
||||
/// let mut components = Path::new("/tmp/foo/bar.txt").components();
|
||||
/// components.next();
|
||||
/// components.next();
|
||||
///
|
||||
/// println!("{:?}", path.components().as_path());
|
||||
/// assert_eq!(Path::new("foo/bar.txt"), components.as_path());
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn as_path(&self) -> &'a Path {
|
||||
|
Loading…
Reference in New Issue
Block a user