Bug 1715209 - [geckodriver] Fix handling of implicit session delete return value. r=webdriver-reviewers,whimboo

The arguments to map_or_else were the wrong way around. Since it's easier to read in this case
switch over to an explicit match statement.

Differential Revision: https://phabricator.services.mozilla.com/D117155
This commit is contained in:
James Graham 2021-06-08 19:26:50 +00:00
parent 9083983080
commit 6d2acef1e8

View File

@ -133,12 +133,10 @@ impl<T: WebDriverHandler<U>, U: WebDriverExtensionRoute> Dispatcher<T, U> {
),
command: WebDriverCommand::DeleteSession,
};
self.handler
.handle_command(&self.session, delete_session)
.map_or_else(
|_| SessionTeardownKind::Deleted,
|_| SessionTeardownKind::NotDeleted,
)
match self.handler.handle_command(&self.session, delete_session) {
Ok(_) => SessionTeardownKind::Deleted,
Err(_) => SessionTeardownKind::NotDeleted,
}
}
_ => kind,
};