@@ -58,10 +58,10 @@ pub fn PosixPath(s: &str) -> PosixPath {
5858}
5959
6060pub trait GenericPath : Clone + Eq + ToStr {
61- /// Converts a string to a Path
61+ /// Converts a string to a path.
6262 fn from_str ( & str ) -> Self ;
6363
64- /// Returns the directory component of `self`, as a string
64+ /// Returns the directory component of `self`, as a string.
6565 fn dirname ( & self ) -> ~str {
6666 let s = self . dir_path ( ) . to_str ( ) ;
6767 match s. len ( ) {
@@ -152,17 +152,17 @@ pub trait GenericPath : Clone + Eq + ToStr {
152152 /// If `self` names a directory, returns the empty path.
153153 fn file_path ( & self ) -> Self ;
154154
155- /// Returns a new Path whose parent directory is `self` and whose
155+ /// Returns a new path whose parent directory is `self` and whose
156156 /// file component is the given string.
157157 fn push ( & self , ( & str ) ) -> Self ;
158158
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`.
160160 fn push_rel ( & self , other : & Self ) -> Self {
161161 assert ! ( !other. is_absolute( ) ) ;
162162 self . push_many ( other. components ( ) )
163163 }
164164
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
166166 /// of strings, relative to `self`.
167167 fn push_many < S : Str > ( & self , ( & [ S ] ) ) -> Self ;
168168
@@ -174,9 +174,9 @@ pub trait GenericPath : Clone + Eq + ToStr {
174174 /// contain directory separators in any of its components.
175175 fn unsafe_join ( & self , ( & Self ) ) -> Self ;
176176
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
178178 /// file stem is one of: `con` `aux` `com1` `com2` `com3` `com4`
179- /// `lpt1` `lpt2` `lpt3` `prn` `nul`
179+ /// `lpt1` `lpt2` `lpt3` `prn` `nul`.
180180 fn is_restricted ( & self ) -> bool ;
181181
182182 /// Returns a new path that names the same file as `self`, without containing
@@ -187,7 +187,8 @@ pub trait GenericPath : Clone + Eq + ToStr {
187187 /// Returns `true` if `self` is an absolute path.
188188 fn is_absolute ( & self ) -> bool ;
189189
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.
191192 fn is_ancestor_of ( & self , other : & Self ) -> bool {
192193 debug ! ( "%s / %s %? %?" , self . to_str( ) , other. to_str( ) , self . is_absolute( ) ,
193194 self . components( ) . len( ) ) ;
@@ -197,7 +198,7 @@ pub trait GenericPath : Clone + Eq + ToStr {
197198 self . is_ancestor_of ( & other. pop ( ) ) )
198199 }
199200
200- /// Find the relative path from one file to another
201+ /// Finds the relative path from one file to another.
201202 fn get_relative_to ( & self , abs2 : ( & Self ) ) -> Self {
202203 assert ! ( self . is_absolute( ) ) ;
203204 assert ! ( abs2. is_absolute( ) ) ;
@@ -516,7 +517,7 @@ impl PosixPath {
516517 }
517518 }
518519
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.
520521 pub fn each_parent ( & self , f : & fn ( & Path ) ) {
521522 if !self . components . is_empty ( ) {
522523 f ( self ) ;
@@ -618,7 +619,7 @@ impl WindowsPath {
618619 }
619620 }
620621
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.
622623 pub fn each_parent ( & self , f : & fn ( & Path ) ) {
623624 if !self . components . is_empty ( ) {
624625 f ( self ) ;
0 commit comments