mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
bug 1492649: geckodriver: avoid a couple of unneeded closures; r=whimboo
This commit is contained in:
parent
618514570b
commit
b23dc7de44
@ -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> {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user