refactor load_paths

This commit is contained in:
Ivan Tham 2020-07-16 21:15:24 +08:00 committed by GitHub
parent 938ba492c4
commit 55c2aa2749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,11 +178,9 @@ fn main() -> std::io::Result<()> {
) )
.get_matches(); .get_matches();
let load_paths = if let Some(load_paths) = matches.values_of("LOAD_PATH") { let load_paths = matches
load_paths.map(|p| Path::new(p)).collect() .values_of("LOAD_PATH")
} else { .map_or_else(Vec::new, |vals| vals.map(Path::new).collect());
Vec::new()
};
let options = &Options::default() let options = &Options::default()
.load_paths(&load_paths) .load_paths(&load_paths)