Skip to content

Commit

Permalink
Minor doc cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuper committed Sep 5, 2013
1 parent 8651011 commit 59291eb
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/libstd/path.rs
Expand Up @@ -58,10 +58,10 @@ pub fn PosixPath(s: &str) -> PosixPath {
}

pub trait GenericPath : Clone + Eq + ToStr {
/// Converts a string to a Path
/// Converts a string to a path.
fn from_str(&str) -> Self;

/// Returns the directory component of `self`, as a string
/// Returns the directory component of `self`, as a string.
fn dirname(&self) -> ~str {
let s = self.dir_path().to_str();
match s.len() {
Expand Down Expand Up @@ -152,17 +152,17 @@ pub trait GenericPath : Clone + Eq + ToStr {
/// If `self` names a directory, returns the empty path.
fn file_path(&self) -> Self;

/// Returns a new Path whose parent directory is `self` and whose
/// Returns a new path whose parent directory is `self` and whose
/// file component is the given string.
fn push(&self, (&str)) -> Self;

/// Returns a new Path consisting of the given path, made relative to `self`.
/// Returns a new path consisting of the given path, made relative to `self`.
fn push_rel(&self, other: &Self) -> Self {
assert!(!other.is_absolute());
self.push_many(other.components())
}

/// Returns a new Path consisting of the path given by the given vector
/// Returns a new path consisting of the path given by the given vector
/// of strings, relative to `self`.
fn push_many<S: Str>(&self, (&[S])) -> Self;

Expand All @@ -174,9 +174,9 @@ pub trait GenericPath : Clone + Eq + ToStr {
/// contain directory separators in any of its components.
fn unsafe_join(&self, (&Self)) -> Self;

/// On Unix, always returns false. On Windows, returns true iff `self`'s
/// On Unix, always returns `false`. On Windows, returns `true` iff `self`'s
/// file stem is one of: `con` `aux` `com1` `com2` `com3` `com4`
/// `lpt1` `lpt2` `lpt3` `prn` `nul`
/// `lpt1` `lpt2` `lpt3` `prn` `nul`.
fn is_restricted(&self) -> bool;

/// Returns a new path that names the same file as `self`, without containing
Expand All @@ -187,7 +187,8 @@ pub trait GenericPath : Clone + Eq + ToStr {
/// Returns `true` if `self` is an absolute path.
fn is_absolute(&self) -> bool;

/// True if `self` is an ancestor of `other`. See `test_is_ancestor_of` for examples
/// True if `self` is an ancestor of `other`.
// See `test_is_ancestor_of` for examples.
fn is_ancestor_of(&self, other: &Self) -> bool {
debug!("%s / %s %? %?", self.to_str(), other.to_str(), self.is_absolute(),
self.components().len());
Expand All @@ -197,7 +198,7 @@ pub trait GenericPath : Clone + Eq + ToStr {
self.is_ancestor_of(&other.pop()))
}

/// Find the relative path from one file to another
/// Finds the relative path from one file to another.
fn get_relative_to(&self, abs2: (&Self)) -> Self {
assert!(self.is_absolute());
assert!(abs2.is_absolute());
Expand Down Expand Up @@ -516,7 +517,7 @@ impl PosixPath {
}
}

/// Execute a function on p as well as all of its ancestors
/// Executes a function `f` on `self` as well as on all of its ancestors.
pub fn each_parent(&self, f: &fn(&Path)) {
if !self.components.is_empty() {
f(self);
Expand Down Expand Up @@ -618,7 +619,7 @@ impl WindowsPath {
}
}

/// Execute a function on p as well as all of its ancestors
/// Executes a function `f` on `self` as well as on all of its ancestors.
pub fn each_parent(&self, f: &fn(&Path)) {
if !self.components.is_empty() {
f(self);
Expand Down

9 comments on commit 59291eb

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at lkuper@59291eb

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging lkuper/rust/default-methods-refactor = 59291eb into auto

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lkuper/rust/default-methods-refactor = 59291eb merged ok, testing candidate = 66134fb

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at lkuper@59291eb

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging lkuper/rust/default-methods-refactor = 59291eb into auto

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lkuper/rust/default-methods-refactor = 59291eb merged ok, testing candidate = f051196

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

@bors
Copy link
Contributor

@bors bors commented on 59291eb Sep 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = f051196

Please sign in to comment.