Bug 1508670 - [geckodriver] Fix Rust code to be compatible with Rust 2018 edition. r=ato
authorHenrik Skupin <mail@hskupin.info>
Thu, 29 Nov 2018 20:45:07 +0000
changeset 505366 8c4e43e477e5bd528f07f67d2d404bda38529aec
parent 505365 17e5d1f4b36ad71fa834e8a655e9b13762c90487
child 505367 c228095e647e155d3638a667341f867774c07a81
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1508670
milestone65.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 1508670 - [geckodriver] Fix Rust code to be compatible with Rust 2018 edition. r=ato Depends on D13399 Differential Revision: https://phabricator.services.mozilla.com/D13400
testing/geckodriver/src/capabilities.rs
testing/geckodriver/src/command.rs
testing/geckodriver/src/main.rs
testing/geckodriver/src/marionette.rs
--- a/testing/geckodriver/src/capabilities.rs
+++ b/testing/geckodriver/src/capabilities.rs
@@ -1,11 +1,11 @@
 use base64;
-use command::LogOptions;
-use logging::Level;
+use crate::command::LogOptions;
+use crate::logging::Level;
 use mozprofile::preferences::Pref;
 use mozprofile::profile::Profile;
 use mozrunner::runner::platform::firefox_default_path;
 use mozversion::{self, firefox_version, Version};
 use regex::bytes::Regex;
 use serde_json::{Map, Value};
 use std::collections::BTreeMap;
 use std::default::Default;
@@ -495,17 +495,17 @@ fn unzip_buffer(buf: &[u8], dest_dir: &P
 }
 
 #[cfg(test)]
 mod tests {
     extern crate mozprofile;
 
     use self::mozprofile::preferences::Pref;
     use super::*;
-    use marionette::MarionetteHandler;
+    use crate::marionette::MarionetteHandler;
     use std::default::Default;
     use std::fs::File;
     use std::io::Read;
 
     use webdriver::capabilities::Capabilities;
 
     fn example_profile() -> Value {
         let mut profile_data = Vec::with_capacity(1024);
--- a/testing/geckodriver/src/command.rs
+++ b/testing/geckodriver/src/command.rs
@@ -1,11 +1,11 @@
 use base64;
+use crate::logging;
 use hyper::Method;
-use logging;
 use regex::Captures;
 use serde::de::{self, Deserialize, Deserializer};
 use serde_json::{self, Value};
 use std::env;
 use std::fs::File;
 use std::io::prelude::*;
 use uuid::Uuid;
 use webdriver::command::{WebDriverCommand, WebDriverExtensionCommand};
@@ -231,19 +231,19 @@ pub struct XblLocatorParameters {
 #[derive(Default, Debug)]
 pub struct LogOptions {
     pub level: Option<logging::Level>,
 }
 
 #[cfg(test)]
 mod tests {
     use super::*;
+    use crate::test::check_deserialize;
     use std::fs::File;
     use std::io::Read;
-    use test::check_deserialize;
 
     #[test]
     fn test_json_addon_install_parameters_null() {
         let json = r#""#;
 
         assert!(serde_json::from_str::<AddonInstallParameters>(&json).is_err());
     }
 
--- a/testing/geckodriver/src/main.rs
+++ b/testing/geckodriver/src/main.rs
@@ -41,19 +41,19 @@ mod capabilities;
 mod command;
 mod logging;
 mod marionette;
 mod prefs;
 
 #[cfg(test)]
 pub mod test;
 
-use build::BuildInfo;
-use command::extension_routes;
-use marionette::{MarionetteHandler, MarionetteSettings};
+use crate::build::BuildInfo;
+use crate::command::extension_routes;
+use crate::marionette::{MarionetteHandler, MarionetteSettings};
 
 type ProgramResult = std::result::Result<(), (ExitCode, String)>;
 
 enum ExitCode {
     Ok = 0,
     Usage = 64,
     Unavailable = 69,
 }
--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -1,11 +1,13 @@
-use command::{AddonInstallParameters, AddonUninstallParameters, GeckoContextParameters,
-              GeckoExtensionCommand, GeckoExtensionRoute, XblLocatorParameters,
-              CHROME_ELEMENT_KEY, LEGACY_ELEMENT_KEY};
+use crate::command::{
+    AddonInstallParameters, AddonUninstallParameters, GeckoContextParameters,
+    GeckoExtensionCommand, GeckoExtensionRoute, XblLocatorParameters, CHROME_ELEMENT_KEY,
+    LEGACY_ELEMENT_KEY,
+};
 use mozprofile::preferences::Pref;
 use mozprofile::profile::Profile;
 use mozrunner::runner::{FirefoxProcess, FirefoxRunner, Runner, RunnerProcess};
 use serde::de::{self, Deserialize, Deserializer};
 use serde::ser::{Serialize, Serializer};
 use serde_json::{self, Map, Value};
 use std::error::Error;
 use std::io::prelude::*;
@@ -43,20 +45,20 @@ use webdriver::command::{ActionsParamete
 use webdriver::command::{WebDriverCommand, WebDriverMessage};
 use webdriver::common::{Cookie, FrameId, WebElement, ELEMENT_KEY, FRAME_KEY, WINDOW_KEY};
 use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult};
 use webdriver::response::{CloseWindowResponse, CookieResponse, CookiesResponse,
                           ElementRectResponse, NewSessionResponse, TimeoutsResponse,
                           ValueResponse, WebDriverResponse, WindowRectResponse};
 use webdriver::server::{Session, WebDriverHandler};
 
-use build::BuildInfo;
-use capabilities::{FirefoxCapabilities, FirefoxOptions};
-use logging;
-use prefs;
+use crate::build::BuildInfo;
+use crate::capabilities::{FirefoxCapabilities, FirefoxOptions};
+use crate::logging;
+use crate::prefs;
 
 // localhost may be routed to the IPv6 stack on certain systems,
 // and nsIServerSocket in Marionette only supports IPv4
 const DEFAULT_HOST: &'static str = "127.0.0.1";
 
 #[derive(Debug, PartialEq, Deserialize)]
 pub struct MarionetteHandshake {
     #[serde(rename = "marionetteProtocol")]