We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d19d7e2 commit a11c279Copy full SHA for a11c279
library/std/src/path.rs
@@ -1992,6 +1992,13 @@ impl Path {
1992
/// assert_eq!(ancestors.next(), Some(Path::new("/foo")));
1993
/// assert_eq!(ancestors.next(), Some(Path::new("/")));
1994
/// assert_eq!(ancestors.next(), None);
1995
+ ///
1996
+ /// let mut ancestors = Path::new("../foo/bar").ancestors();
1997
+ /// assert_eq!(ancestors.next(), Some(Path::new("../foo/bar")));
1998
+ /// assert_eq!(ancestors.next(), Some(Path::new("../foo")));
1999
+ /// assert_eq!(ancestors.next(), Some(Path::new("..")));
2000
+ /// assert_eq!(ancestors.next(), Some(Path::new("")));
2001
+ /// assert_eq!(ancestors.next(), None);
2002
/// ```
2003
///
2004
/// [`None`]: ../../std/option/enum.Option.html#variant.None
0 commit comments