webdriver: Merge pull request #14 from andreastt/derive_debug
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 18 Jan 2016 18:09:15 +0000
changeset 428052 e3dd00b7c196b69a4430b9472eba4f2a5484d4a9
parent 428051 5cc8b2ed8a3074cb30db61101916fc32696efc21
child 428053 2571871b62eddafbb98809e8d04579c9904a9d1b
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone57.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
webdriver: Merge pull request #14 from andreastt/derive_debug Derive Debug trait for WebElement and FrameId Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 8300b62283f87b0dfd0158fff4c8bb60d0b8c193
testing/webdriver/src/common.rs
--- a/testing/webdriver/src/common.rs
+++ b/testing/webdriver/src/common.rs
@@ -1,10 +1,10 @@
+use rustc_serialize::{Encodable, Encoder};
 use rustc_serialize::json::{Json, ToJson};
-use rustc_serialize::{Encodable, Encoder};
 use std::collections::BTreeMap;
 use std::error::Error;
 
 use error::{WebDriverResult, WebDriverError, ErrorStatus};
 
 pub static ELEMENT_KEY: &'static str = "element-6066-11e4-a52e-4f735466cecf";
 
 #[derive(RustcEncodable, PartialEq, Clone, Debug)]
@@ -69,17 +69,17 @@ impl<T: ToJson> Encodable for Nullable<T
     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
         match *self {
             Nullable::Value(ref x) => x.to_json().encode(s),
             Nullable::Null => s.emit_option_none()
         }
     }
 }
 
-#[derive(PartialEq)]
+#[derive(PartialEq, Debug)]
 pub struct WebElement {
     pub id: String
 }
 
 impl WebElement {
     pub fn new(id: String) -> WebElement {
         WebElement {
             id: id
@@ -105,17 +105,17 @@ impl WebElement {
 impl ToJson for WebElement {
     fn to_json(&self) -> Json {
         let mut data = BTreeMap::new();
         data.insert(ELEMENT_KEY.to_string(), self.id.to_json());
         Json::Object(data)
     }
 }
 
-#[derive(PartialEq)]
+#[derive(PartialEq, Debug)]
 pub enum FrameId {
     Short(u16),
     Element(WebElement),
     Null
 }
 
 impl FrameId {
     pub fn from_json(data: &Json) -> WebDriverResult<FrameId> {