simplify somewhat how load paths are calculated from the cli
This commit is contained in:
parent
179b368ef8
commit
938ba492c4
11
src/main.rs
11
src/main.rs
@ -178,15 +178,14 @@ fn main() -> std::io::Result<()> {
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
let vals: Vec<&Path>;
|
||||
if let Some(load_paths) = matches.values_of("LOAD_PATH") {
|
||||
vals = load_paths.map(|p| Path::new(p)).collect();
|
||||
let load_paths = if let Some(load_paths) = matches.values_of("LOAD_PATH") {
|
||||
load_paths.map(|p| Path::new(p)).collect()
|
||||
} else {
|
||||
vals = Vec::new();
|
||||
}
|
||||
Vec::new()
|
||||
};
|
||||
|
||||
let options = &Options::default()
|
||||
.load_paths(&vals)
|
||||
.load_paths(&load_paths)
|
||||
.quiet(matches.is_present("QUIET"))
|
||||
.unicode_error_messages(!matches.is_present("NO_UNICODE"))
|
||||
.allows_charset(!matches.is_present("NO_CHARSET"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user