Bug 1575263 - Move closure out of if statement r=jgraham
authorDavid Heiberg <dheiberg@mozilla.com>
Thu, 29 Aug 2019 13:38:32 +0000
changeset 554386 62c8064a6be0e0aed89bbcd26ce37a7533b9e200
parent 554385 55378cbba628e718e8228e9687a2b25cc8339eb6
child 554387 a284f570400baa5a56d262816b2f41c73b7f7892
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1575263
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1575263 - Move closure out of if statement r=jgraham Differential Revision: https://phabricator.services.mozilla.com/D43971
testing/geckodriver/src/capabilities.rs
--- a/testing/geckodriver/src/capabilities.rs
+++ b/testing/geckodriver/src/capabilities.rs
@@ -243,19 +243,20 @@ impl<'a> BrowserCapabilities for Firefox
                             }
                         }
                         "prefs" => {
                             let prefs_data = try_opt!(
                                 value.as_object(),
                                 ErrorStatus::InvalidArgument,
                                 "prefs value is not an object"
                             );
-                            if !prefs_data.values().all(|x| {
+                            let is_pref_value_type = |x:&Value| {
                                 x.is_string() || x.is_i64() || x.is_u64() || x.is_boolean()
-                            }) {
+                            };
+                            if !prefs_data.values().all(is_pref_value_type) {
                                 return Err(WebDriverError::new(
                                     ErrorStatus::InvalidArgument,
                                     "Preference values not all string or integer or boolean",
                                 ));
                             }
                         }
                         x => {
                             return Err(WebDriverError::new(