Bug 1487989: webdriver: deref matched expressions; r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Sat, 01 Sep 2018 14:36:34 +0100
changeset 434566 5a41ca05867bbc20f7d52422a2f0c72085cad532
parent 434565 015d294ad0ea3f87e2393646a4e6ad5461b8fa10
child 434567 2ecbda656977be5802b827a08de357455035abfb
push id107423
push userato@sny.no
push dateTue, 04 Sep 2018 12:31:13 +0000
treeherdermozilla-inbound@5a41ca05867b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1487989
milestone63.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 1487989: webdriver: deref matched expressions; r=whimboo Instead of accessing each variant using a reference, we should dereference the matched expression when possible.
testing/webdriver/src/capabilities.rs
testing/webdriver/src/command.rs
--- a/testing/webdriver/src/capabilities.rs
+++ b/testing/webdriver/src/capabilities.rs
@@ -158,17 +158,17 @@ impl SpecNewSessionParameters {
                 }
             }
         }
         Ok(capabilities)
     }
 
     fn validate_page_load_strategy(value: &Value) -> WebDriverResult<()> {
         match value {
-            &Value::String(ref x) => match &**x {
+            Value::String(x) => match &**x {
                 "normal" | "eager" | "none" => {}
                 x => {
                     return Err(WebDriverError::new(
                         ErrorStatus::InvalidArgument,
                         format!("Invalid page load strategy: {}", x),
                     ))
                 }
             },
--- a/testing/webdriver/src/command.rs
+++ b/testing/webdriver/src/command.rs
@@ -466,18 +466,18 @@ impl<'de> Deserialize<'de> for NewSessio
 }
 
 impl CapabilitiesMatching for NewSessionParameters {
     fn match_browser<T: BrowserCapabilities>(
         &self,
         browser_capabilities: &mut T,
     ) -> WebDriverResult<Option<Capabilities>> {
         match self {
-            &NewSessionParameters::Spec(ref x) => x.match_browser(browser_capabilities),
-            &NewSessionParameters::Legacy(ref x) => x.match_browser(browser_capabilities),
+            NewSessionParameters::Spec(x) => x.match_browser(browser_capabilities),
+            NewSessionParameters::Legacy(x) => x.match_browser(browser_capabilities),
         }
     }
 }
 
 #[derive(Debug, PartialEq, Serialize, Deserialize)]
 pub struct SendKeysParameters {
     pub text: String,
 }