Auto merge of #28030 - tshepang:improve-example, r=alexcrichton
This commit is contained in:
commit
b28f0b1887
1 changed files with 4 additions and 2 deletions
|
@ -632,9 +632,11 @@ impl<'a> Components<'a> {
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::path::Path;
|
/// 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")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub fn as_path(&self) -> &'a Path {
|
pub fn as_path(&self) -> &'a Path {
|
||||||
|
|
Loading…
Reference in a new issue