@@ -58,10 +58,10 @@ pub fn PosixPath(s: &str) -> PosixPath {
58
58
}
59
59
60
60
pub trait GenericPath : Clone + Eq + ToStr {
61
- /// Converts a string to a Path
61
+ /// Converts a string to a path.
62
62
fn from_str ( & str ) -> Self ;
63
63
64
- /// Returns the directory component of `self`, as a string
64
+ /// Returns the directory component of `self`, as a string.
65
65
fn dirname ( & self ) -> ~str {
66
66
let s = self . dir_path ( ) . to_str ( ) ;
67
67
match s. len ( ) {
@@ -152,17 +152,17 @@ pub trait GenericPath : Clone + Eq + ToStr {
152
152
/// If `self` names a directory, returns the empty path.
153
153
fn file_path ( & self ) -> Self ;
154
154
155
- /// Returns a new Path whose parent directory is `self` and whose
155
+ /// Returns a new path whose parent directory is `self` and whose
156
156
/// file component is the given string.
157
157
fn push ( & self , ( & str ) ) -> Self ;
158
158
159
- /// Returns a new Path consisting of the given path, made relative to `self`.
159
+ /// Returns a new path consisting of the given path, made relative to `self`.
160
160
fn push_rel ( & self , other : & Self ) -> Self {
161
161
assert ! ( !other. is_absolute( ) ) ;
162
162
self . push_many ( other. components ( ) )
163
163
}
164
164
165
- /// Returns a new Path consisting of the path given by the given vector
165
+ /// Returns a new path consisting of the path given by the given vector
166
166
/// of strings, relative to `self`.
167
167
fn push_many < S : Str > ( & self , ( & [ S ] ) ) -> Self ;
168
168
@@ -174,9 +174,9 @@ pub trait GenericPath : Clone + Eq + ToStr {
174
174
/// contain directory separators in any of its components.
175
175
fn unsafe_join ( & self , ( & Self ) ) -> Self ;
176
176
177
- /// On Unix, always returns false. On Windows, returns true iff `self`'s
177
+ /// On Unix, always returns ` false` . On Windows, returns ` true` iff `self`'s
178
178
/// file stem is one of: `con` `aux` `com1` `com2` `com3` `com4`
179
- /// `lpt1` `lpt2` `lpt3` `prn` `nul`
179
+ /// `lpt1` `lpt2` `lpt3` `prn` `nul`.
180
180
fn is_restricted ( & self ) -> bool ;
181
181
182
182
/// Returns a new path that names the same file as `self`, without containing
@@ -187,7 +187,8 @@ pub trait GenericPath : Clone + Eq + ToStr {
187
187
/// Returns `true` if `self` is an absolute path.
188
188
fn is_absolute ( & self ) -> bool ;
189
189
190
- /// True if `self` is an ancestor of `other`. See `test_is_ancestor_of` for examples
190
+ /// True if `self` is an ancestor of `other`.
191
+ // See `test_is_ancestor_of` for examples.
191
192
fn is_ancestor_of ( & self , other : & Self ) -> bool {
192
193
debug ! ( "%s / %s %? %?" , self . to_str( ) , other. to_str( ) , self . is_absolute( ) ,
193
194
self . components( ) . len( ) ) ;
@@ -197,7 +198,7 @@ pub trait GenericPath : Clone + Eq + ToStr {
197
198
self . is_ancestor_of ( & other. pop ( ) ) )
198
199
}
199
200
200
- /// Find the relative path from one file to another
201
+ /// Finds the relative path from one file to another.
201
202
fn get_relative_to ( & self , abs2 : ( & Self ) ) -> Self {
202
203
assert ! ( self . is_absolute( ) ) ;
203
204
assert ! ( abs2. is_absolute( ) ) ;
@@ -516,7 +517,7 @@ impl PosixPath {
516
517
}
517
518
}
518
519
519
- /// Execute a function on p as well as all of its ancestors
520
+ /// Executes a function `f` on `self` as well as on all of its ancestors.
520
521
pub fn each_parent ( & self , f : & fn ( & Path ) ) {
521
522
if !self . components . is_empty ( ) {
522
523
f ( self ) ;
@@ -618,7 +619,7 @@ impl WindowsPath {
618
619
}
619
620
}
620
621
621
- /// Execute a function on p as well as all of its ancestors
622
+ /// Executes a function `f` on `self` as well as on all of its ancestors.
622
623
pub fn each_parent ( & self , f : & fn ( & Path ) ) {
623
624
if !self . components . is_empty ( ) {
624
625
f ( self ) ;
0 commit comments