Skip to content

Commit

Permalink
Stabilize std::path::Path:ancestors
Browse files Browse the repository at this point in the history
  • Loading branch information
teiesti committed Jun 18, 2018
1 parent 862703e commit 65d119c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,6 @@ impl<'a> cmp::Ord for Components<'a> {
/// # Examples
///
/// ```
/// #![feature(path_ancestors)]
///
/// use std::path::Path;
///
/// let path = Path::new("/foo/bar");
Expand All @@ -1056,12 +1054,12 @@ impl<'a> cmp::Ord for Components<'a> {
/// [`ancestors`]: struct.Path.html#method.ancestors
/// [`Path`]: struct.Path.html
#[derive(Copy, Clone, Debug)]
#[unstable(feature = "path_ancestors", issue = "48581")]
#[stable(feature = "path_ancestors", since = "1.28.0")]
pub struct Ancestors<'a> {
next: Option<&'a Path>,
}

#[unstable(feature = "path_ancestors", issue = "48581")]
#[stable(feature = "path_ancestors", since = "1.28.0")]
impl<'a> Iterator for Ancestors<'a> {
type Item = &'a Path;

Expand All @@ -1075,7 +1073,7 @@ impl<'a> Iterator for Ancestors<'a> {
}
}

#[unstable(feature = "path_ancestors", issue = "48581")]
#[stable(feature = "path_ancestors", since = "1.28.0")]
impl<'a> FusedIterator for Ancestors<'a> {}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1890,8 +1888,6 @@ impl Path {
/// # Examples
///
/// ```
/// #![feature(path_ancestors)]
///
/// use std::path::Path;
///
/// let mut ancestors = Path::new("/foo/bar").ancestors();
Expand All @@ -1903,7 +1899,7 @@ impl Path {
///
/// [`None`]: ../../std/option/enum.Option.html#variant.None
/// [`parent`]: struct.Path.html#method.parent
#[unstable(feature = "path_ancestors", issue = "48581")]
#[stable(feature = "path_ancestors", since = "1.28.0")]
pub fn ancestors(&self) -> Ancestors {
Ancestors {
next: Some(&self),
Expand Down

0 comments on commit 65d119c

Please sign in to comment.