mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 17:35:16 +01:00
Move current_directory variable definition closer to usage
This commit is contained in:
parent
a5f69579cf
commit
cb6295d025
1 changed files with 1 additions and 2 deletions
|
@ -123,8 +123,6 @@ fn extract_search_pattern(matches: &clap::ArgMatches) -> Result<&'_ str> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn extract_search_paths(matches: &clap::ArgMatches) -> Result<Vec<PathBuf>> {
|
fn extract_search_paths(matches: &clap::ArgMatches) -> Result<Vec<PathBuf>> {
|
||||||
let current_directory = Path::new(".");
|
|
||||||
|
|
||||||
let parameter_paths = matches
|
let parameter_paths = matches
|
||||||
.values_of_os("path")
|
.values_of_os("path")
|
||||||
.or_else(|| matches.values_of_os("search-path"));
|
.or_else(|| matches.values_of_os("search-path"));
|
||||||
|
@ -145,6 +143,7 @@ fn extract_search_paths(matches: &clap::ArgMatches) -> Result<Vec<PathBuf>> {
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
None => {
|
None => {
|
||||||
|
let current_directory = Path::new(".");
|
||||||
ensure_current_directory_exists(current_directory)?;
|
ensure_current_directory_exists(current_directory)?;
|
||||||
vec![current_directory.to_path_buf()]
|
vec![current_directory.to_path_buf()]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue