Bug 1575263 - Change to_ to into_ to suit naming convention regarding self methods r=jgraham
authorDavid Heiberg <dheiberg@mozilla.com>
Thu, 29 Aug 2019 13:25:18 +0000
changeset 554385 55378cbba628e718e8228e9687a2b25cc8339eb6
parent 554384 542dfee3630a15b4a1594fba7a46cca652d79d88
child 554386 62c8064a6be0e0aed89bbcd26ce37a7533b9e200
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 - Change to_ to into_ to suit naming convention regarding self methods r=jgraham Differential Revision: https://phabricator.services.mozilla.com/D43970
testing/geckodriver/src/marionette.rs
--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -477,17 +477,17 @@ impl MarionetteSession {
             | GetCSSValue(_, _)
             | GetElementText(_)
             | GetElementTagName(_)
             | IsEnabled(_)
             | ExecuteScript(_)
             | ExecuteAsyncScript(_)
             | GetAlertText
             | TakeScreenshot
-            | TakeElementScreenshot(_) => WebDriverResponse::Generic(resp.to_value_response(true)?),
+            | TakeElementScreenshot(_) => WebDriverResponse::Generic(resp.into_value_response(true)?),
             GetTimeouts => {
                 let script = match try_opt!(
                     resp.result.get("script"),
                     ErrorStatus::UnknownError,
                     "Missing field: script"
                 ) {
                     Value::Null => None,
                     n => try_opt!(
@@ -521,17 +521,17 @@ impl MarionetteSession {
 
                 WebDriverResponse::Timeouts(TimeoutsResponse {
                     script,
                     page_load,
                     implicit,
                 })
             }
             Status => panic!("Got status command that should already have been handled"),
-            GetWindowHandles => WebDriverResponse::Generic(resp.to_value_response(false)?),
+            GetWindowHandles => WebDriverResponse::Generic(resp.into_value_response(false)?),
             NewWindow(_) => {
                 let handle: String = try_opt!(
                     try_opt!(
                         resp.result.get("handle"),
                         ErrorStatus::UnknownError,
                         "Failed to find handle field"
                     )
                     .as_str(),
@@ -756,17 +756,17 @@ impl MarionetteSession {
 
                 WebDriverResponse::NewSession(NewSessionResponse::new(
                     session_id.to_string(),
                     Value::Object(capabilities.clone()),
                 ))
             }
             DeleteSession => WebDriverResponse::DeleteSession,
             Extension(ref extension) => match extension {
-                GetContext => WebDriverResponse::Generic(resp.to_value_response(true)?),
+                GetContext => WebDriverResponse::Generic(resp.into_value_response(true)?),
                 SetContext(_) => WebDriverResponse::Void,
                 XblAnonymousChildren(_) => {
                     let els_vec = try_opt!(
                         resp.result.as_array(),
                         ErrorStatus::UnknownError,
                         "Failed to interpret body as array"
                     );
                     let els = els_vec
@@ -779,19 +779,19 @@ impl MarionetteSession {
                 XblAnonymousByAttribute(_, _) => {
                     let el = self.to_web_element(try_opt!(
                         resp.result.get("value"),
                         ErrorStatus::UnknownError,
                         "Failed to find value field"
                     ))?;
                     WebDriverResponse::Generic(ValueResponse(serde_json::to_value(el)?))
                 }
-                InstallAddon(_) => WebDriverResponse::Generic(resp.to_value_response(true)?),
+                InstallAddon(_) => WebDriverResponse::Generic(resp.into_value_response(true)?),
                 UninstallAddon(_) => WebDriverResponse::Void,
-                TakeFullScreenshot => WebDriverResponse::Generic(resp.to_value_response(true)?),
+                TakeFullScreenshot => WebDriverResponse::Generic(resp.into_value_response(true)?),
             },
         })
     }
 }
 
 fn try_convert_to_marionette_message(
     msg: &WebDriverMessage<GeckoExtensionRoute>,
 ) -> WebDriverResult<Option<Command>> {
@@ -1107,17 +1107,17 @@ impl<'de> Deserialize<'de> for Marionett
             id: wrapper.id,
             error: wrapper.error,
             result: wrapper.result,
         })
     }
 }
 
 impl MarionetteResponse {
-    fn to_value_response(self, value_required: bool) -> WebDriverResult<ValueResponse> {
+    fn into_value_response(self, value_required: bool) -> WebDriverResult<ValueResponse> {
         let value: &Value = if value_required {
             try_opt!(
                 self.result.get("value"),
                 ErrorStatus::UnknownError,
                 "Failed to find value field"
             )
         } else {
             &self.result