@@ -26,7 +26,7 @@ impl Simpath {
26
26
///
27
27
/// fn main() {
28
28
/// let search_path = Simpath::new("PATH");
29
- /// let ls_file = search_path.find_file ("ls");
29
+ /// let ls_file = search_path.find ("ls");
30
30
/// match ls_file {
31
31
/// Ok(path) => println!("'ls' was found at '{}'", path.display()),
32
32
/// Err(e) => println!("{}", e)
@@ -77,14 +77,14 @@ impl Simpath {
77
77
///
78
78
/// fn main() {
79
79
/// let search_path = Simpath::new("PATH");
80
- /// match search_path.find_file ("my-file") {
80
+ /// match search_path.find ("my-file") {
81
81
/// Ok(_found_dir) => println!("Didn't expect that!!"),
82
82
/// Err(e) => println!("{}", e.to_string())
83
83
/// }
84
84
/// }
85
85
/// ```
86
86
///
87
- pub fn find_file ( & self , file_name : & str ) -> Result < PathBuf , Error > {
87
+ pub fn find ( & self , file_name : & str ) -> Result < PathBuf , Error > {
88
88
for search_dir in & self . dirs {
89
89
for entry in fs:: read_dir ( search_dir) ? {
90
90
let file = entry?;
@@ -94,7 +94,7 @@ impl Simpath {
94
94
}
95
95
}
96
96
Err ( Error :: new ( ErrorKind :: NotFound ,
97
- format ! ( "Could not find file '{}' in search path '{}'" ,
97
+ format ! ( "Could not find '{}' in search path '{}'" ,
98
98
file_name, self . name) ) )
99
99
}
100
100
@@ -201,7 +201,7 @@ mod test {
201
201
#[ test]
202
202
fn find_non_existant_file ( ) {
203
203
let path = Simpath :: new ( "MyName" ) ;
204
- assert ! ( path. find_file ( "no_such_file" ) . is_err( ) ) ;
204
+ assert ! ( path. find ( "no_such_file" ) . is_err( ) ) ;
205
205
}
206
206
207
207
#[ test]
0 commit comments