bug 1492649: geckodriver: avoid a couple of unneeded closures; r=whimboo

This commit is contained in:
Andreas Tolfsen 2018-09-20 01:32:56 +01:00
parent 618514570b
commit b23dc7de44
2 changed files with 3 additions and 3 deletions

View File

@ -48,9 +48,9 @@ impl<'a> FirefoxCapabilities<'a> {
.get("moz:firefoxOptions")
.and_then(|x| x.get("binary"))
.and_then(|x| x.as_str())
.map(|x| PathBuf::from(x))
.map(PathBuf::from)
.or_else(|| self.fallback_binary.map(|x| x.clone()))
.or_else(|| firefox_default_path())
.or_else(firefox_default_path)
}
fn version(&mut self) -> Option<String> {

View File

@ -160,7 +160,7 @@ fn run() -> ProgramResult {
Err(_) => return Err((ExitCode::Usage, "invalid host address".into())),
};
let binary = matches.value_of("binary").map(|x| PathBuf::from(x));
let binary = matches.value_of("binary").map(PathBuf::from);
let marionette_port = match matches.value_of("marionette_port") {
Some(x) => match u16::from_str(x) {