Bug 1441204 - Upgrade winreg crate from 0.5.0 to 0.5.1. r=maja_zf
authorAndreas Tolfsen <ato@sny.no>
Thu, 14 Jun 2018 13:04:25 -0700
changeset 422752 371a38d383d5327f5dd056721e650859ffdc90f1
parent 422751 66765efe2e494b3d59386ba8a3f65b665a0e55c7
child 422753 903c65173f3b13e75c0abc2ca0398655bc7c4cf8
push id65245
push useratolfsen@mozilla.com
push dateFri, 15 Jun 2018 22:52:36 +0000
treeherderautoland@c7d3022be642 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1441204
milestone62.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 1441204 - Upgrade winreg crate from 0.5.0 to 0.5.1. r=maja_zf MozReview-Commit-ID: EtBBvUGnTzb
Cargo.lock
third_party/rust/winreg/.cargo-checksum.json
third_party/rust/winreg/.editorconfig
third_party/rust/winreg/Cargo.toml
third_party/rust/winreg/README.md
third_party/rust/winreg/examples/installed_apps.rs
third_party/rust/winreg/src/decoder/serialization_serde.rs
third_party/rust/winreg/src/encoder/mod.rs
third_party/rust/winreg/src/encoder/serialization_serde.rs
third_party/rust/winreg/src/lib.rs
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1280,17 +1280,17 @@ dependencies = [
 ]
 
 [[package]]
 name = "mozrunner"
 version = "0.6.1"
 dependencies = [
  "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "mozprofile 0.3.0",
- "winreg 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "mozurl"
 version = "0.0.1"
 dependencies = [
  "nserror 0.1.0",
  "nsstring 0.1.0",
@@ -2436,17 +2436,17 @@ name = "wincolor"
 version = "0.1.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "winreg"
-version = "0.5.0"
+version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "ws2_32-sys"
 version = "0.2.1"
@@ -2742,13 +2742,13 @@ dependencies = [
 "checksum webidl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc14e4b71f94b5bb4c6d696e3b3be4d2e9ee6750a60870ecae09ff7138a131a7"
 "checksum which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4be6cfa54dab45266e98b5d7be2f8ce959ddd49abd141a05d52dce4b07f803bb"
 "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
 "checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3"
 "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
 "checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767"
-"checksum winreg 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9338067aba07889a38beaad4dbb77fa2e62e87c423b770824b3bdf412874bd2c"
+"checksum winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a"
 "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
 "checksum xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2"
 "checksum yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57ab38ee1a4a266ed033496cf9af1828d8d6e6c1cfa5f643a2809effcae4d628"
 "checksum zip 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "77ce0ceee93c995954a31f77903925a6a8bb094709445238e344f2107910e29e"
--- a/third_party/rust/winreg/.cargo-checksum.json
+++ b/third_party/rust/winreg/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"8faaec7ac4c9f7ee202a4a8ba6cbfa538b69c7b0895e5dfe1754211396fbc088","LICENSE":"ea021d8c6383c84d19c15ce90d3b1602cf448fdcc0bf3772c98e43c7bf1bf1d1","README.md":"e1155738eb37f5674788d85087e905f99f37448cc982553bfa1852082b058a24","appveyor.yml":"986d99d18ffd511d6d4a357109d2b3ded4eea7449f49c339c6ca221064bb3bb0","examples/basic_usage.rs":"de70cb705ab3ccbf3681df106656b6398f9df27d0e7d21f7ef9a1ea51335b0cf","examples/enum.rs":"7e18a35960c824f88a122a4ae67020b44579379c0268fa7f37641b03aacb55cc","examples/installed_apps.rs":"7e1c877f99e2b8d6f46c35addf649a48d7ec5469f9ef5ac5a17f4983ca73b069","examples/serialization.rs":"b82553788bef12a9164c2a42d9ae99fceaef1e752286219ee8b24374cb5a8b19","examples/transactions.rs":"6fb7d7c7811aadab840b5ba36dfef9e8c19c0f874e02f54f90b73b16f455be70","src/decoder/mod.rs":"68064e7d0312be72152f008593377ac56bdad45fa5a007446a4358fbae17cfd0","src/decoder/serialization_serde.rs":"04fb262cdc6ee5e0673eaf76c6df1e4c7fce8ee425280bb276859b5a70e71a82","src/encoder/mod.rs":"87194068ca619a20251ce16d0d5d691a9da2493e4cea135d8f65905aebde96f3","src/encoder/serialization_serde.rs":"5da3acb2b6d9e189545a20f5c2fb68ae23e6d528b09af954c881913f21c7afd3","src/enums.rs":"8117cd8281018e092bb756836a1cc5d2bd826a87f20d9ead67a09c94296649f5","src/lib.rs":"c27a2761a5354106507a9de0eb99b3be0563a6772cde729d12e63dda9a835dfe","src/transaction.rs":"e6c9d5ae895b3d397ce0436c7dd9562ad60405c8fedd6730e3801d69a9e84e74","src/types.rs":"c16db1ab91b1250ca1c510f20977d5046987764395c0f545a950c5a049428183"},"package":"9338067aba07889a38beaad4dbb77fa2e62e87c423b770824b3bdf412874bd2c"}
\ No newline at end of file
+{"files":{".editorconfig":"902f40b01fe8cf3ee9a798c4c02c451cf0f3a2afd24e0bc1b03254a2c6ddbad8","Cargo.toml":"a1e8f0c4b5eab990649c6963190f190a033bca7035b85f88ea0836bfb10c9348","LICENSE":"ea021d8c6383c84d19c15ce90d3b1602cf448fdcc0bf3772c98e43c7bf1bf1d1","README.md":"137d72ca6c03e6876abb162733b305718591e28ab42f00689cb1bec7dbc38409","appveyor.yml":"986d99d18ffd511d6d4a357109d2b3ded4eea7449f49c339c6ca221064bb3bb0","examples/basic_usage.rs":"de70cb705ab3ccbf3681df106656b6398f9df27d0e7d21f7ef9a1ea51335b0cf","examples/enum.rs":"7e18a35960c824f88a122a4ae67020b44579379c0268fa7f37641b03aacb55cc","examples/installed_apps.rs":"0e210f33218649182276824f6cb461c2085ca9f8ca7c687318405b7896fd4d42","examples/serialization.rs":"b82553788bef12a9164c2a42d9ae99fceaef1e752286219ee8b24374cb5a8b19","examples/transactions.rs":"6fb7d7c7811aadab840b5ba36dfef9e8c19c0f874e02f54f90b73b16f455be70","src/decoder/mod.rs":"68064e7d0312be72152f008593377ac56bdad45fa5a007446a4358fbae17cfd0","src/decoder/serialization_serde.rs":"4fc46761f5139661bdc5fa2c490000701c5df71d1b4803ae41823acad0d0ded6","src/encoder/mod.rs":"2614013d7be54f5f39a21b8e75511e950d703e4571f9a63292ae51507a21c612","src/encoder/serialization_serde.rs":"a03fceb693761257a8bc4f72984e2a551f5a1d86e57fee6acdcc39934b8a9ee4","src/enums.rs":"8117cd8281018e092bb756836a1cc5d2bd826a87f20d9ead67a09c94296649f5","src/lib.rs":"ab3d8696a09a027a784b6baf7a3bbf852a6f029eb3914015c800f2761992f65c","src/transaction.rs":"e6c9d5ae895b3d397ce0436c7dd9562ad60405c8fedd6730e3801d69a9e84e74","src/types.rs":"c16db1ab91b1250ca1c510f20977d5046987764395c0f545a950c5a049428183"},"package":"a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a"}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/third_party/rust/winreg/.editorconfig
@@ -0,0 +1,13 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+indent_size = 4
+
+[*.yml]
+indent_style = space
+indent_size = 2
--- a/third_party/rust/winreg/Cargo.toml
+++ b/third_party/rust/winreg/Cargo.toml
@@ -7,22 +7,23 @@
 #
 # If you believe there's an error in this file please file an
 # issue against the rust-lang/cargo repository. If you're
 # editing this file be aware that the upstream Cargo.toml
 # will likely look very different (and much more reasonable)
 
 [package]
 name = "winreg"
-version = "0.5.0"
+version = "0.5.1"
 authors = ["Igor Shaula <gentoo90@gmail.com>"]
 description = "Rust bindings to MS Windows Registry API"
-documentation = "https://gentoo90.github.io/winreg-rs/v0.5.0/winreg/index.html"
+documentation = "https://gentoo90.github.io/winreg-rs/v0.5.1/winreg"
 readme = "README.md"
 keywords = ["Windows", "WinSDK", "Registry"]
+categories = ["api-bindings", "os::windows-apis"]
 license = "MIT"
 repository = "https://github.com/gentoo90/winreg-rs"
 
 [[example]]
 name = "basic_usage"
 
 [[example]]
 name = "enum"
--- a/third_party/rust/winreg/README.md
+++ b/third_party/rust/winreg/README.md
@@ -216,46 +216,51 @@ fn main() {
 
     // This shows `false` because f32 and f64 encoding/decoding is NOT precise
     println!("Equal to encoded: {:?}", v1 == v2);
 }
 ```
 
 ## Changelog
 
+### 0.5.1
+
+* Reexport `HKEY` ([#15](https://github.com/gentoo90/winreg-rs/issues/15)).
+* Add `raw_handle` method ([#18](https://github.com/gentoo90/winreg-rs/pull/18)).
+
 ### 0.5.0
 
 * Breaking change: `open_subkey` now opens a key with readonly permissions.
 Use `create_subkey` or `open_subkey_with_flags` to open with read-write permissins.
 * Breaking change: features `transactions` and `serialization-serde` are now disabled by default.
 * Breaking change: serialization now uses `serde` instead of `rustc-serialize`.
 * `winreg` updated to `0.3`.
-* Documentation fixes (#14)
+* Documentation fixes ([#14](https://github.com/gentoo90/winreg-rs/pull/14))
 
 ### 0.4.0
 
 * Make transactions and serialization otional features
-* Update dependensies + minor fixes (#12)
+* Update dependensies + minor fixes ([#12](https://github.com/gentoo90/winreg-rs/pull/12))
 
 ### 0.3.5
 
-* Implement `FromRegValue` for `OsString` and `ToRegValue` for `OsStr` (#8)
+* Implement `FromRegValue` for `OsString` and `ToRegValue` for `OsStr` ([#8](https://github.com/gentoo90/winreg-rs/issues/8))
 * Minor fixes
 
 ### 0.3.4
 
 * Add `copy_tree` method to `RegKey`
 * Now checked with [rust-clippy](https://github.com/Manishearth/rust-clippy)
     * no more `unwrap`s
     * replaced `to_string` with `to_owned`
-* Fix: reading strings longer than 2048 characters (#6)
+* Fix: reading strings longer than 2048 characters ([#6](https://github.com/gentoo90/winreg-rs/pull/6))
 
 ### 0.3.3
 
-* Fix: now able to read values longer than 2048 bytes (#3)
+* Fix: now able to read values longer than 2048 bytes ([#3](https://github.com/gentoo90/winreg-rs/pull/3))
 
 ### 0.3.2
 
 * Fix: `FromRegValue` trait now requires `Sized` (fixes build with rust 1.4)
 
 ### 0.3.1
 
 * Fix: bump `winapi` version to fix build
--- a/third_party/rust/winreg/examples/installed_apps.rs
+++ b/third_party/rust/winreg/examples/installed_apps.rs
@@ -1,43 +1,43 @@
-// Copyright 2017, Igor Shaula
-// Licensed under the MIT License <LICENSE or
-// http://opensource.org/licenses/MIT>. This file
-// may not be copied, modified, or distributed
-// except according to those terms.
-#[macro_use]
-extern crate serde_derive;
-extern crate winreg;
-use winreg::enums::*;
-use std::collections::HashMap;
-use std::fmt;
-
-#[allow(non_snake_case)]
-#[derive(Debug, Serialize, Deserialize)]
-struct InstalledApp {
-    DisplayName: Option<String>,
-    DisplayVersion: Option<String>,
-    UninstallString: Option<String>
-}
-
-macro_rules! str_from_opt {
-    ($s:expr) => { $s.as_ref().map(|x| &**x).unwrap_or("") }
-}
-
-impl fmt::Display for InstalledApp {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        write!(f, "{}-{}",
-            str_from_opt!(self.DisplayName),
-            str_from_opt!(self.DisplayVersion))
-    }
-}
-
-fn main() {
-    let hklm = winreg::RegKey::predef(HKEY_LOCAL_MACHINE);
-    let uninstall_key = hklm.open_subkey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")
-        .expect("key is missing");
-
-    let apps: HashMap<String, InstalledApp> = uninstall_key.decode().expect("deserialization failed");
-
-    for (_k, v) in &apps {
-        println!("{}", v);
-    }
-}
+// Copyright 2017, Igor Shaula
+// Licensed under the MIT License <LICENSE or
+// http://opensource.org/licenses/MIT>. This file
+// may not be copied, modified, or distributed
+// except according to those terms.
+#[macro_use]
+extern crate serde_derive;
+extern crate winreg;
+use winreg::enums::*;
+use std::collections::HashMap;
+use std::fmt;
+
+#[allow(non_snake_case)]
+#[derive(Debug, Serialize, Deserialize)]
+struct InstalledApp {
+    DisplayName: Option<String>,
+    DisplayVersion: Option<String>,
+    UninstallString: Option<String>
+}
+
+macro_rules! str_from_opt {
+    ($s:expr) => { $s.as_ref().map(|x| &**x).unwrap_or("") }
+}
+
+impl fmt::Display for InstalledApp {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}-{}",
+            str_from_opt!(self.DisplayName),
+            str_from_opt!(self.DisplayVersion))
+    }
+}
+
+fn main() {
+    let hklm = winreg::RegKey::predef(HKEY_LOCAL_MACHINE);
+    let uninstall_key = hklm.open_subkey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")
+        .expect("key is missing");
+
+    let apps: HashMap<String, InstalledApp> = uninstall_key.decode().expect("deserialization failed");
+
+    for (_k, v) in &apps {
+        println!("{}", v);
+    }
+}
--- a/third_party/rust/winreg/src/decoder/serialization_serde.rs
+++ b/third_party/rust/winreg/src/decoder/serialization_serde.rs
@@ -1,221 +1,221 @@
-// Copyright 2017, Igor Shaula
-// Licensed under the MIT License <LICENSE or
-// http://opensource.org/licenses/MIT>. This file
-// may not be copied, modified, or distributed
-// except according to those terms.
-use std::mem;
-use std::fmt;
-use serde::de::*;
-use super::{DecoderError, DecodeResult, DecoderReadingState, DecoderEnumerationState, Decoder, DECODER_SAM};
-use super::super::FromRegValue;
-
-impl Error for DecoderError {
-    fn custom<T: fmt::Display>(msg: T) -> Self {
-        DecoderError::DeserializerError(format!("{}", msg))
-    }
-}
-
-impl<'de, 'a> Deserializer<'de> for &'a mut Decoder {
-    type Error = DecoderError;
-    fn deserialize_any<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        use self::DecoderEnumerationState::*;
-        match self.enumeration_state {
-            EnumeratingKeys(..) => no_impl!("deserialize_any for keys"),
-            EnumeratingValues(..) => {
-                let s = self.f_name.as_ref().ok_or(DecoderError::NoFieldName)?;
-                let v = self.key.get_raw_value(s)?;
-                use RegType::*;
-                match v.vtype {
-                    REG_SZ | REG_EXPAND_SZ | REG_MULTI_SZ => visitor.visit_string(String::from_reg_value(&v)?),
-                    REG_DWORD => visitor.visit_u32(u32::from_reg_value(&v)?),
-                    REG_QWORD => visitor.visit_u64(u64::from_reg_value(&v)?),
-                    _ => Err(DecoderError::DecodeNotImplemented("value type deserialization not implemented".to_owned()))
-                }
-            }
-        }
-    }
-
-    fn deserialize_bool<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_bool(read_value!(self).map(|v: u32| v > 0)?)
-    }
-
-    fn deserialize_u8<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        self.deserialize_u32(visitor)
-    }
-
-    fn deserialize_u16<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        self.deserialize_u32(visitor)
-    }
-
-    fn deserialize_u32<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_u32(read_value!(self)?)
-    }
-
-    fn deserialize_u64<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_u64(read_value!(self)?)
-    }
-
-    fn deserialize_i8<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_i8(parse_string!(self)?)
-    }
-
-    fn deserialize_i16<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_i16(parse_string!(self)?)
-    }
-
-    fn deserialize_i32<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_i32(parse_string!(self)?)
-    }
-
-    fn deserialize_i64<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_i64(parse_string!(self)?)
-    }
-
-    fn deserialize_f32<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_f32(parse_string!(self)?)
-    }
-
-    fn deserialize_f64<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_f64(parse_string!(self)?)
-    }
-
-    fn deserialize_char<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_char")
-    }
-
-    fn deserialize_str<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_str")
-    }
-
-    fn deserialize_string<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        use self::DecoderReadingState::*;
-        match self.reading_state {
-            WaitingForKey => {
-                let s = self.f_name.as_ref().ok_or(DecoderError::NoFieldName)?;
-                visitor.visit_string(s.clone())
-            }
-            WaitingForValue => visitor.visit_string(read_value!(self)?)
-        }
-    }
-
-    fn deserialize_bytes<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_bytes")
-    }
-
-    fn deserialize_byte_buf<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_byte_buf")
-    }
-
-    fn deserialize_option<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        let v = {
-            let s = self.f_name.as_ref().ok_or(DecoderError::NoFieldName)?;
-            self.key.get_raw_value(s)
-        };
-        match v {
-            Ok(..) => visitor.visit_some(&mut *self),
-            Err(..) => visitor.visit_none()
-        }
-    }
-
-    fn deserialize_unit<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_unit")
-    }
-
-    fn deserialize_unit_struct<V>(self, _name: &'static str, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_unit_struct")
-    }
-
-    fn deserialize_newtype_struct<V>(self, _name: &'static str, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_newtype_struct")
-    }
-
-    fn deserialize_seq<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_seq")
-    }
-
-    fn deserialize_tuple<V>(self, _len: usize, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_tuple")
-    }
-
-    fn deserialize_tuple_struct<V>(self, _name: &'static str, _len: usize, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_tuple_struct")
-    }
-
-    fn deserialize_map<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_map(self)
-    }
-
-    fn deserialize_struct<V>(self, _name: &'static str, _fields: &'static [&'static str], visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        visitor.visit_map(self)
-    }
-
-    fn deserialize_identifier<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        self.deserialize_string(visitor)
-    }
-
-    fn deserialize_enum<V>(self, _name: &'static str, _variants: &'static [&'static str], _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        no_impl!("deserialize_enum")
-    }
-
-    fn deserialize_ignored_any<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
-        self.deserialize_any(visitor)
-    }
-}
-
-impl<'de, 'a> MapAccess<'de> for Decoder {
-    type Error = DecoderError;
-    fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Self::Error>
-        where K: DeserializeSeed<'de>
-    {
-        self.reading_state = DecoderReadingState::WaitingForKey;
-        use self::DecoderEnumerationState::*;
-        match self.enumeration_state {
-            EnumeratingKeys(index) => {
-                match self.key.enum_key(index) {
-                    Some(res) => {
-                        self.f_name = Some(res?);
-                        self.enumeration_state = EnumeratingKeys(index + 1);
-                        seed.deserialize(&mut *self).map(Some)
-                    }
-                    None => {
-                        self.enumeration_state = EnumeratingValues(0);
-                        self.next_key_seed(seed)
-                    }
-                }
-            }
-            EnumeratingValues(index) => {
-                let next_value = self.key.enum_value(index);
-                match next_value {
-                    Some(res) => {
-                        self.f_name = Some(res?.0);
-                        self.enumeration_state = EnumeratingValues(index + 1);
-                        seed.deserialize(&mut *self).map(Some)
-                    }
-                    None => Ok(None),
-                }
-            }
-        }
-    }
-
-    fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>
-        where V: DeserializeSeed<'de>
-    {
-        self.reading_state = DecoderReadingState::WaitingForValue;
-        use self::DecoderEnumerationState::*;
-        match self.enumeration_state {
-            EnumeratingKeys(..) => {
-                let f_name = self.f_name.as_ref().ok_or(DecoderError::NoFieldName)?;
-                match self.key.open_subkey_with_flags(f_name, DECODER_SAM) {
-                    Ok(subkey) => {
-                        let mut nested = Decoder::new(subkey);
-                        seed.deserialize(&mut nested)
-                    }
-                    Err(err) => Err(DecoderError::IoError(err)),
-                }
-            },
-            EnumeratingValues(..) => {
-                seed.deserialize(&mut *self)
-            }
-        }
-    }
-}
+// Copyright 2017, Igor Shaula
+// Licensed under the MIT License <LICENSE or
+// http://opensource.org/licenses/MIT>. This file
+// may not be copied, modified, or distributed
+// except according to those terms.
+use std::mem;
+use std::fmt;
+use serde::de::*;
+use super::{DecoderError, DecodeResult, DecoderReadingState, DecoderEnumerationState, Decoder, DECODER_SAM};
+use super::super::FromRegValue;
+
+impl Error for DecoderError {
+    fn custom<T: fmt::Display>(msg: T) -> Self {
+        DecoderError::DeserializerError(format!("{}", msg))
+    }
+}
+
+impl<'de, 'a> Deserializer<'de> for &'a mut Decoder {
+    type Error = DecoderError;
+    fn deserialize_any<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        use self::DecoderEnumerationState::*;
+        match self.enumeration_state {
+            EnumeratingKeys(..) => no_impl!("deserialize_any for keys"),
+            EnumeratingValues(..) => {
+                let s = self.f_name.as_ref().ok_or(DecoderError::NoFieldName)?;
+                let v = self.key.get_raw_value(s)?;
+                use RegType::*;
+                match v.vtype {
+                    REG_SZ | REG_EXPAND_SZ | REG_MULTI_SZ => visitor.visit_string(String::from_reg_value(&v)?),
+                    REG_DWORD => visitor.visit_u32(u32::from_reg_value(&v)?),
+                    REG_QWORD => visitor.visit_u64(u64::from_reg_value(&v)?),
+                    _ => Err(DecoderError::DecodeNotImplemented("value type deserialization not implemented".to_owned()))
+                }
+            }
+        }
+    }
+
+    fn deserialize_bool<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_bool(read_value!(self).map(|v: u32| v > 0)?)
+    }
+
+    fn deserialize_u8<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        self.deserialize_u32(visitor)
+    }
+
+    fn deserialize_u16<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        self.deserialize_u32(visitor)
+    }
+
+    fn deserialize_u32<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_u32(read_value!(self)?)
+    }
+
+    fn deserialize_u64<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_u64(read_value!(self)?)
+    }
+
+    fn deserialize_i8<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_i8(parse_string!(self)?)
+    }
+
+    fn deserialize_i16<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_i16(parse_string!(self)?)
+    }
+
+    fn deserialize_i32<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_i32(parse_string!(self)?)
+    }
+
+    fn deserialize_i64<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_i64(parse_string!(self)?)
+    }
+
+    fn deserialize_f32<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_f32(parse_string!(self)?)
+    }
+
+    fn deserialize_f64<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_f64(parse_string!(self)?)
+    }
+
+    fn deserialize_char<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_char")
+    }
+
+    fn deserialize_str<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_str")
+    }
+
+    fn deserialize_string<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        use self::DecoderReadingState::*;
+        match self.reading_state {
+            WaitingForKey => {
+                let s = self.f_name.as_ref().ok_or(DecoderError::NoFieldName)?;
+                visitor.visit_string(s.clone())
+            }
+            WaitingForValue => visitor.visit_string(read_value!(self)?)
+        }
+    }
+
+    fn deserialize_bytes<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_bytes")
+    }
+
+    fn deserialize_byte_buf<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_byte_buf")
+    }
+
+    fn deserialize_option<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        let v = {
+            let s = self.f_name.as_ref().ok_or(DecoderError::NoFieldName)?;
+            self.key.get_raw_value(s)
+        };
+        match v {
+            Ok(..) => visitor.visit_some(&mut *self),
+            Err(..) => visitor.visit_none()
+        }
+    }
+
+    fn deserialize_unit<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_unit")
+    }
+
+    fn deserialize_unit_struct<V>(self, _name: &'static str, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_unit_struct")
+    }
+
+    fn deserialize_newtype_struct<V>(self, _name: &'static str, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_newtype_struct")
+    }
+
+    fn deserialize_seq<V>(self, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_seq")
+    }
+
+    fn deserialize_tuple<V>(self, _len: usize, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_tuple")
+    }
+
+    fn deserialize_tuple_struct<V>(self, _name: &'static str, _len: usize, _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_tuple_struct")
+    }
+
+    fn deserialize_map<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_map(self)
+    }
+
+    fn deserialize_struct<V>(self, _name: &'static str, _fields: &'static [&'static str], visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        visitor.visit_map(self)
+    }
+
+    fn deserialize_identifier<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        self.deserialize_string(visitor)
+    }
+
+    fn deserialize_enum<V>(self, _name: &'static str, _variants: &'static [&'static str], _visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        no_impl!("deserialize_enum")
+    }
+
+    fn deserialize_ignored_any<V>(self, visitor: V) -> DecodeResult<V::Value> where V: Visitor<'de> {
+        self.deserialize_any(visitor)
+    }
+}
+
+impl<'de, 'a> MapAccess<'de> for Decoder {
+    type Error = DecoderError;
+    fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Self::Error>
+        where K: DeserializeSeed<'de>
+    {
+        self.reading_state = DecoderReadingState::WaitingForKey;
+        use self::DecoderEnumerationState::*;
+        match self.enumeration_state {
+            EnumeratingKeys(index) => {
+                match self.key.enum_key(index) {
+                    Some(res) => {
+                        self.f_name = Some(res?);
+                        self.enumeration_state = EnumeratingKeys(index + 1);
+                        seed.deserialize(&mut *self).map(Some)
+                    }
+                    None => {
+                        self.enumeration_state = EnumeratingValues(0);
+                        self.next_key_seed(seed)
+                    }
+                }
+            }
+            EnumeratingValues(index) => {
+                let next_value = self.key.enum_value(index);
+                match next_value {
+                    Some(res) => {
+                        self.f_name = Some(res?.0);
+                        self.enumeration_state = EnumeratingValues(index + 1);
+                        seed.deserialize(&mut *self).map(Some)
+                    }
+                    None => Ok(None),
+                }
+            }
+        }
+    }
+
+    fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>
+        where V: DeserializeSeed<'de>
+    {
+        self.reading_state = DecoderReadingState::WaitingForValue;
+        use self::DecoderEnumerationState::*;
+        match self.enumeration_state {
+            EnumeratingKeys(..) => {
+                let f_name = self.f_name.as_ref().ok_or(DecoderError::NoFieldName)?;
+                match self.key.open_subkey_with_flags(f_name, DECODER_SAM) {
+                    Ok(subkey) => {
+                        let mut nested = Decoder::new(subkey);
+                        seed.deserialize(&mut nested)
+                    }
+                    Err(err) => Err(DecoderError::IoError(err)),
+                }
+            },
+            EnumeratingValues(..) => {
+                seed.deserialize(&mut *self)
+            }
+        }
+    }
+}
--- a/third_party/rust/winreg/src/encoder/mod.rs
+++ b/third_party/rust/winreg/src/encoder/mod.rs
@@ -1,105 +1,105 @@
-// Copyright 2017, Igor Shaula
-// Licensed under the MIT License <LICENSE or
-// http://opensource.org/licenses/MIT>. This file
-// may not be copied, modified, or distributed
-// except according to those terms.
-use std::io;
-use std::fmt;
-use std::error::Error;
-use winapi::shared::minwindef::DWORD;
-use super::RegKey;
-use super::enums::*;
-use super::transaction::Transaction;
-use self::EncoderState::*;
-
-macro_rules! emit_value{
-    ($s:ident, $v:ident) => (
-        match mem::replace(&mut $s.state, Start) {
-            NextKey(ref s) => {
-                $s.keys[$s.keys.len()-1].set_value(s, &$v)
-                    .map_err(EncoderError::IoError)
-            },
-            Start => Err(EncoderError::NoFieldName)
-        }
-    )
-}
-
-macro_rules! no_impl {
-    ($e:expr) => (
-        Err(EncoderError::EncodeNotImplemented($e.to_owned()))
-    )
-}
-
-#[cfg(feature = "serialization-serde")] mod serialization_serde;
-
-#[derive(Debug)]
-pub enum EncoderError{
-    EncodeNotImplemented(String),
-    SerializerError(String),
-    IoError(io::Error),
-    NoFieldName,
-}
-
-impl fmt::Display for EncoderError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        write!(f, "{:?}", self)
-    }
-}
-
-impl Error for EncoderError {
-    fn description(&self) -> &str {
-        use self::EncoderError::*;
-        match *self {
-            EncodeNotImplemented(ref s) | SerializerError(ref s) => s,
-            IoError(ref e) => e.description(),
-            NoFieldName => "No field name"
-        }
-    }
-}
-
-pub type EncodeResult<T> = Result<T, EncoderError>;
-
-impl From<io::Error> for EncoderError {
-    fn from(err: io::Error) -> EncoderError {
-        EncoderError::IoError(err)
-    }
-}
-
-#[derive(Debug)]
-enum EncoderState {
-    Start,
-    NextKey(String),
-    // NextMapKey,
-}
-
-#[derive(Debug)]
-pub struct Encoder {
-    keys: Vec<RegKey>,
-    tr: Transaction,
-    state: EncoderState,
-}
-
-const ENCODER_SAM: DWORD = KEY_CREATE_SUB_KEY|KEY_SET_VALUE;
-
-impl Encoder {
-    pub fn from_key(key: &RegKey) -> EncodeResult<Encoder> {
-        let tr = try!(Transaction::new());
-        key.open_subkey_transacted_with_flags("", &tr, ENCODER_SAM)
-            .map(|k| Encoder::new(k, tr))
-            .map_err(EncoderError::IoError)
-    }
-
-    fn new(key: RegKey, tr: Transaction) -> Encoder {
-        let mut keys = Vec::with_capacity(5);
-        keys.push(key);
-        Encoder{
-            keys: keys,
-            tr: tr,
-            state: Start,
-        }
-    }
-
-    pub fn commit(&mut self) -> EncodeResult<()> {
-        self.tr.commit().map_err(EncoderError::IoError)
-    }
-}
+// Copyright 2017, Igor Shaula
+// Licensed under the MIT License <LICENSE or
+// http://opensource.org/licenses/MIT>. This file
+// may not be copied, modified, or distributed
+// except according to those terms.
+use std::io;
+use std::fmt;
+use std::error::Error;
+use winapi::shared::minwindef::DWORD;
+use super::RegKey;
+use super::enums::*;
+use super::transaction::Transaction;
+use self::EncoderState::*;
+
+macro_rules! emit_value{
+    ($s:ident, $v:ident) => (
+        match mem::replace(&mut $s.state, Start) {
+            NextKey(ref s) => {
+                $s.keys[$s.keys.len()-1].set_value(s, &$v)
+                    .map_err(EncoderError::IoError)
+            },
+            Start => Err(EncoderError::NoFieldName)
+        }
+    )
+}
+
+macro_rules! no_impl {
+    ($e:expr) => (
+        Err(EncoderError::EncodeNotImplemented($e.to_owned()))
+    )
+}
+
+#[cfg(feature = "serialization-serde")] mod serialization_serde;
+
+#[derive(Debug)]
+pub enum EncoderError{
+    EncodeNotImplemented(String),
+    SerializerError(String),
+    IoError(io::Error),
+    NoFieldName,
+}
+
+impl fmt::Display for EncoderError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{:?}", self)
+    }
+}
+
+impl Error for EncoderError {
+    fn description(&self) -> &str {
+        use self::EncoderError::*;
+        match *self {
+            EncodeNotImplemented(ref s) | SerializerError(ref s) => s,
+            IoError(ref e) => e.description(),
+            NoFieldName => "No field name"
+        }
+    }
+}
+
+pub type EncodeResult<T> = Result<T, EncoderError>;
+
+impl From<io::Error> for EncoderError {
+    fn from(err: io::Error) -> EncoderError {
+        EncoderError::IoError(err)
+    }
+}
+
+#[derive(Debug)]
+enum EncoderState {
+    Start,
+    NextKey(String),
+    // NextMapKey,
+}
+
+#[derive(Debug)]
+pub struct Encoder {
+    keys: Vec<RegKey>,
+    tr: Transaction,
+    state: EncoderState,
+}
+
+const ENCODER_SAM: DWORD = KEY_CREATE_SUB_KEY|KEY_SET_VALUE;
+
+impl Encoder {
+    pub fn from_key(key: &RegKey) -> EncodeResult<Encoder> {
+        let tr = try!(Transaction::new());
+        key.open_subkey_transacted_with_flags("", &tr, ENCODER_SAM)
+            .map(|k| Encoder::new(k, tr))
+            .map_err(EncoderError::IoError)
+    }
+
+    fn new(key: RegKey, tr: Transaction) -> Encoder {
+        let mut keys = Vec::with_capacity(5);
+        keys.push(key);
+        Encoder{
+            keys: keys,
+            tr: tr,
+            state: Start,
+        }
+    }
+
+    pub fn commit(&mut self) -> EncodeResult<()> {
+        self.tr.commit().map_err(EncoderError::IoError)
+    }
+}
--- a/third_party/rust/winreg/src/encoder/serialization_serde.rs
+++ b/third_party/rust/winreg/src/encoder/serialization_serde.rs
@@ -1,312 +1,312 @@
-// Copyright 2017, Igor Shaula
-// Licensed under the MIT License <LICENSE or
-// http://opensource.org/licenses/MIT>. This file
-// may not be copied, modified, or distributed
-// except according to those terms.
-use std::fmt;
-use std::mem;
-use super::{Encoder, EncoderError, EncodeResult, ENCODER_SAM};
-use super::EncoderState::*;
-use serde::ser::*;
-
-impl Error for EncoderError {
-    fn custom<T: fmt::Display>(msg: T) -> Self {
-        EncoderError::SerializerError(format!("{}", msg))
-    }
-}
-
-
-impl<'a> Serializer for &'a mut Encoder {
-    type Ok = ();
-    type Error = EncoderError;
-
-    type SerializeSeq = SeqEncoder;
-    type SerializeTuple = TupleEncoder;
-    type SerializeTupleStruct = TupleStructEncoder;
-    type SerializeTupleVariant = TupleVariantEncoder;
-    type SerializeMap = MapEncoder<'a>;
-    type SerializeStruct = StructEncoder<'a>;
-    type SerializeStructVariant = StructVariantEncoder;
-
-    fn serialize_bool(self, value: bool) -> EncodeResult<Self::Ok> {
-        self.serialize_u32(value as u32)
-    }
-
-    fn serialize_i8(self, value: i8) -> EncodeResult<Self::Ok> {
-        self.serialize_i64(value as i64)
-    }
-
-    fn serialize_i16(self, value: i16) -> EncodeResult<Self::Ok> {
-        self.serialize_i64(value as i64)
-    }
-
-    fn serialize_i32(self, value: i32) -> EncodeResult<Self::Ok> {
-        self.serialize_i64(value as i64)
-    }
-
-    fn serialize_i64(self, value: i64) -> EncodeResult<Self::Ok> {
-        let s = value.to_string();
-        emit_value!(self, s)
-    }
-
-    fn serialize_u8(self, value: u8) -> EncodeResult<Self::Ok> {
-        self.serialize_u32(value as u32)
-    }
-
-    fn serialize_u16(self, value: u16) -> EncodeResult<Self::Ok> {
-        self.serialize_u32(value as u32)
-    }
-
-    fn serialize_u32(self, value: u32) -> EncodeResult<Self::Ok> {
-        emit_value!(self, value)
-    }
-
-    fn serialize_u64(self, value: u64) -> EncodeResult<Self::Ok> {
-        emit_value!(self, value)
-    }
-
-    fn serialize_f32(self, value: f32) -> EncodeResult<Self::Ok> {
-        let s = value.to_string();
-        emit_value!(self, s)
-    }
-
-    fn serialize_f64(self, value: f64) -> EncodeResult<Self::Ok> {
-        let s = value.to_string();
-        emit_value!(self, s)
-    }
-
-    fn serialize_char(self, _value: char) -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_char")
-    }
-
-    fn serialize_str(self, value: &str) -> EncodeResult<Self::Ok> {
-        emit_value!(self, value)
-    }
-
-    fn serialize_bytes(self, _value: &[u8]) -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_bytes")
-    }
-
-    fn serialize_none(self) -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_none")
-    }
-
-    fn serialize_some<T: ?Sized + Serialize>(self, _value: &T) -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_some")
-    }
-
-    fn serialize_unit(self) -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_unit")
-    }
-
-    fn serialize_unit_struct(self, _name: &'static str) -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_unit_struct")
-    }
-
-    fn serialize_unit_variant(self,
-                              _name: &'static str,
-                              _variant_index: u32,
-                              _variant: &'static str)
-                              -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_unit_variant")
-    }
-
-    fn serialize_newtype_struct<T: ?Sized + Serialize>(self,
-                                                       _name: &'static str,
-                                                       _value: &T)
-                                                       -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_newtype_struct")
-    }
-
-    fn serialize_newtype_variant<T: ?Sized + Serialize>(self,
-                                                        _name: &'static str,
-                                                        _variant_index: u32,
-                                                        _variant: &'static str,
-                                                        _value: &T)
-                                                        -> EncodeResult<Self::Ok> {
-        no_impl!("serialize_newtype_variant")
-    }
-
-    fn serialize_seq(self, _len: Option<usize>) -> EncodeResult<Self::SerializeSeq> {
-        no_impl!("serialize_seq")
-    }
-
-    fn serialize_tuple(self, _len: usize) -> EncodeResult<Self::SerializeTuple> {
-        no_impl!("serialize_tuple")
-    }
-
-    fn serialize_tuple_struct(self,
-                              _name: &'static str,
-                              _len: usize)
-                              -> EncodeResult<Self::SerializeTupleStruct> {
-        no_impl!("serialize_tuple_struct")
-    }
-
-    fn serialize_tuple_variant(self,
-                               _name: &'static str,
-                               _variant_index: u32,
-                               _variant: &'static str,
-                               _len: usize)
-                               -> EncodeResult<Self::SerializeTupleVariant> {
-        no_impl!("serialize_tuple_variant")
-    }
-
-    fn serialize_map(self, _len: Option<usize>) -> EncodeResult<Self::SerializeMap> {
-        Ok(MapEncoder { _enc: self })
-    }
-
-    fn serialize_struct(self,
-                        _name: &'static str,
-                        _len: usize)
-                        -> EncodeResult<Self::SerializeStruct> {
-        match mem::replace(&mut self.state, Start) {
-            Start => {
-                // root structure
-                Ok(StructEncoder { enc: self, is_root: true })
-            }
-            NextKey(ref s) => {
-                // nested structure
-                match self.keys[self.keys.len() - 1]
-                    .create_subkey_transacted_with_flags(&s, &self.tr, ENCODER_SAM) {
-                    Ok(subkey) => {
-                        self.keys.push(subkey);
-                        Ok(StructEncoder { enc: self, is_root: true })
-                    }
-                    Err(err) => Err(EncoderError::IoError(err)),
-                }
-            }
-        }
-    }
-
-    fn serialize_struct_variant(self,
-                                _name: &'static str,
-                                _variant_index: u32,
-                                _variant: &'static str,
-                                _len: usize)
-                                -> EncodeResult<Self::SerializeStructVariant> {
-        no_impl!("serialize_struct_variant")
-    }
-}
-
-pub struct SeqEncoder {}
-
-impl SerializeSeq for SeqEncoder {
-    type Ok = ();
-    type Error = EncoderError;
-    fn serialize_element<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeSeq::serialize_element")
-    }
-    fn end(self) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeSeq::end")
-    }
-}
-
-pub struct TupleEncoder {}
-
-impl SerializeTuple for TupleEncoder {
-    type Ok = ();
-    type Error = EncoderError;
-
-    fn serialize_element<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeTuple::serialize_element")
-    }
-
-    fn end(self) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeTuple::end")
-    }
-}
-
-pub struct TupleStructEncoder {}
-
-impl SerializeTupleStruct for TupleStructEncoder {
-    type Ok = ();
-    type Error = EncoderError;
-
-    fn serialize_field<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeTupleStruct::serialize_field")
-    }
-
-    fn end(self) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeTupleStruct::end")
-    }
-}
-
-pub struct TupleVariantEncoder {}
-
-impl SerializeTupleVariant for TupleVariantEncoder {
-    type Ok = ();
-    type Error = EncoderError;
-
-    fn serialize_field<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeTupleVariant::serialize_field")
-    }
-
-    fn end(self) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeTupleVariant::end")
-    }
-}
-
-pub struct MapEncoder<'a> {
-    _enc: &'a mut Encoder,
-}
-
-impl<'a> SerializeMap for MapEncoder<'a> {
-    type Ok = ();
-    type Error = EncoderError;
-
-    fn serialize_key<T: ?Sized + Serialize>(&mut self, _key: &T) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeMap::serialize_key")
-    }
-
-    fn serialize_value<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeMap::serialize_value")
-    }
-
-    fn end(self) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeMap::end")
-    }
-}
-
-pub struct StructEncoder<'a> {
-    enc: &'a mut Encoder,
-    is_root: bool
-}
-
-impl<'a> SerializeStruct for StructEncoder<'a> {
-    type Ok = ();
-    type Error = EncoderError;
-
-    fn serialize_field<T: ?Sized + Serialize>(&mut self,
-                                              key: &'static str,
-                                              value: &T)
-                                              -> EncodeResult<Self::Ok> {
-        self.enc.state = NextKey(String::from(key));
-        value.serialize(&mut *self.enc)
-    }
-
-    fn end(self) -> EncodeResult<Self::Ok> {
-        if self.is_root {
-            self.enc.keys.pop();
-        }
-        Ok(())
-    }
-}
-
-pub struct StructVariantEncoder {}
-
-impl SerializeStructVariant for StructVariantEncoder {
-    type Ok = ();
-    type Error = EncoderError;
-
-    fn serialize_field<T: ?Sized + Serialize>(&mut self,
-                                              _key: &'static str,
-                                              _value: &T)
-                                              -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeStructVariant::serialize_field")
-    }
-
-    fn end(self) -> EncodeResult<Self::Ok> {
-        no_impl!("SerializeStructVariant::end")
-    }
-}
-
+// Copyright 2017, Igor Shaula
+// Licensed under the MIT License <LICENSE or
+// http://opensource.org/licenses/MIT>. This file
+// may not be copied, modified, or distributed
+// except according to those terms.
+use std::fmt;
+use std::mem;
+use super::{Encoder, EncoderError, EncodeResult, ENCODER_SAM};
+use super::EncoderState::*;
+use serde::ser::*;
+
+impl Error for EncoderError {
+    fn custom<T: fmt::Display>(msg: T) -> Self {
+        EncoderError::SerializerError(format!("{}", msg))
+    }
+}
+
+
+impl<'a> Serializer for &'a mut Encoder {
+    type Ok = ();
+    type Error = EncoderError;
+
+    type SerializeSeq = SeqEncoder;
+    type SerializeTuple = TupleEncoder;
+    type SerializeTupleStruct = TupleStructEncoder;
+    type SerializeTupleVariant = TupleVariantEncoder;
+    type SerializeMap = MapEncoder<'a>;
+    type SerializeStruct = StructEncoder<'a>;
+    type SerializeStructVariant = StructVariantEncoder;
+
+    fn serialize_bool(self, value: bool) -> EncodeResult<Self::Ok> {
+        self.serialize_u32(value as u32)
+    }
+
+    fn serialize_i8(self, value: i8) -> EncodeResult<Self::Ok> {
+        self.serialize_i64(value as i64)
+    }
+
+    fn serialize_i16(self, value: i16) -> EncodeResult<Self::Ok> {
+        self.serialize_i64(value as i64)
+    }
+
+    fn serialize_i32(self, value: i32) -> EncodeResult<Self::Ok> {
+        self.serialize_i64(value as i64)
+    }
+
+    fn serialize_i64(self, value: i64) -> EncodeResult<Self::Ok> {
+        let s = value.to_string();
+        emit_value!(self, s)
+    }
+
+    fn serialize_u8(self, value: u8) -> EncodeResult<Self::Ok> {
+        self.serialize_u32(value as u32)
+    }
+
+    fn serialize_u16(self, value: u16) -> EncodeResult<Self::Ok> {
+        self.serialize_u32(value as u32)
+    }
+
+    fn serialize_u32(self, value: u32) -> EncodeResult<Self::Ok> {
+        emit_value!(self, value)
+    }
+
+    fn serialize_u64(self, value: u64) -> EncodeResult<Self::Ok> {
+        emit_value!(self, value)
+    }
+
+    fn serialize_f32(self, value: f32) -> EncodeResult<Self::Ok> {
+        let s = value.to_string();
+        emit_value!(self, s)
+    }
+
+    fn serialize_f64(self, value: f64) -> EncodeResult<Self::Ok> {
+        let s = value.to_string();
+        emit_value!(self, s)
+    }
+
+    fn serialize_char(self, _value: char) -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_char")
+    }
+
+    fn serialize_str(self, value: &str) -> EncodeResult<Self::Ok> {
+        emit_value!(self, value)
+    }
+
+    fn serialize_bytes(self, _value: &[u8]) -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_bytes")
+    }
+
+    fn serialize_none(self) -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_none")
+    }
+
+    fn serialize_some<T: ?Sized + Serialize>(self, _value: &T) -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_some")
+    }
+
+    fn serialize_unit(self) -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_unit")
+    }
+
+    fn serialize_unit_struct(self, _name: &'static str) -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_unit_struct")
+    }
+
+    fn serialize_unit_variant(self,
+                              _name: &'static str,
+                              _variant_index: u32,
+                              _variant: &'static str)
+                              -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_unit_variant")
+    }
+
+    fn serialize_newtype_struct<T: ?Sized + Serialize>(self,
+                                                       _name: &'static str,
+                                                       _value: &T)
+                                                       -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_newtype_struct")
+    }
+
+    fn serialize_newtype_variant<T: ?Sized + Serialize>(self,
+                                                        _name: &'static str,
+                                                        _variant_index: u32,
+                                                        _variant: &'static str,
+                                                        _value: &T)
+                                                        -> EncodeResult<Self::Ok> {
+        no_impl!("serialize_newtype_variant")
+    }
+
+    fn serialize_seq(self, _len: Option<usize>) -> EncodeResult<Self::SerializeSeq> {
+        no_impl!("serialize_seq")
+    }
+
+    fn serialize_tuple(self, _len: usize) -> EncodeResult<Self::SerializeTuple> {
+        no_impl!("serialize_tuple")
+    }
+
+    fn serialize_tuple_struct(self,
+                              _name: &'static str,
+                              _len: usize)
+                              -> EncodeResult<Self::SerializeTupleStruct> {
+        no_impl!("serialize_tuple_struct")
+    }
+
+    fn serialize_tuple_variant(self,
+                               _name: &'static str,
+                               _variant_index: u32,
+                               _variant: &'static str,
+                               _len: usize)
+                               -> EncodeResult<Self::SerializeTupleVariant> {
+        no_impl!("serialize_tuple_variant")
+    }
+
+    fn serialize_map(self, _len: Option<usize>) -> EncodeResult<Self::SerializeMap> {
+        Ok(MapEncoder { _enc: self })
+    }
+
+    fn serialize_struct(self,
+                        _name: &'static str,
+                        _len: usize)
+                        -> EncodeResult<Self::SerializeStruct> {
+        match mem::replace(&mut self.state, Start) {
+            Start => {
+                // root structure
+                Ok(StructEncoder { enc: self, is_root: true })
+            }
+            NextKey(ref s) => {
+                // nested structure
+                match self.keys[self.keys.len() - 1]
+                    .create_subkey_transacted_with_flags(&s, &self.tr, ENCODER_SAM) {
+                    Ok(subkey) => {
+                        self.keys.push(subkey);
+                        Ok(StructEncoder { enc: self, is_root: true })
+                    }
+                    Err(err) => Err(EncoderError::IoError(err)),
+                }
+            }
+        }
+    }
+
+    fn serialize_struct_variant(self,
+                                _name: &'static str,
+                                _variant_index: u32,
+                                _variant: &'static str,
+                                _len: usize)
+                                -> EncodeResult<Self::SerializeStructVariant> {
+        no_impl!("serialize_struct_variant")
+    }
+}
+
+pub struct SeqEncoder {}
+
+impl SerializeSeq for SeqEncoder {
+    type Ok = ();
+    type Error = EncoderError;
+    fn serialize_element<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeSeq::serialize_element")
+    }
+    fn end(self) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeSeq::end")
+    }
+}
+
+pub struct TupleEncoder {}
+
+impl SerializeTuple for TupleEncoder {
+    type Ok = ();
+    type Error = EncoderError;
+
+    fn serialize_element<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeTuple::serialize_element")
+    }
+
+    fn end(self) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeTuple::end")
+    }
+}
+
+pub struct TupleStructEncoder {}
+
+impl SerializeTupleStruct for TupleStructEncoder {
+    type Ok = ();
+    type Error = EncoderError;
+
+    fn serialize_field<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeTupleStruct::serialize_field")
+    }
+
+    fn end(self) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeTupleStruct::end")
+    }
+}
+
+pub struct TupleVariantEncoder {}
+
+impl SerializeTupleVariant for TupleVariantEncoder {
+    type Ok = ();
+    type Error = EncoderError;
+
+    fn serialize_field<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeTupleVariant::serialize_field")
+    }
+
+    fn end(self) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeTupleVariant::end")
+    }
+}
+
+pub struct MapEncoder<'a> {
+    _enc: &'a mut Encoder,
+}
+
+impl<'a> SerializeMap for MapEncoder<'a> {
+    type Ok = ();
+    type Error = EncoderError;
+
+    fn serialize_key<T: ?Sized + Serialize>(&mut self, _key: &T) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeMap::serialize_key")
+    }
+
+    fn serialize_value<T: ?Sized + Serialize>(&mut self, _value: &T) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeMap::serialize_value")
+    }
+
+    fn end(self) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeMap::end")
+    }
+}
+
+pub struct StructEncoder<'a> {
+    enc: &'a mut Encoder,
+    is_root: bool
+}
+
+impl<'a> SerializeStruct for StructEncoder<'a> {
+    type Ok = ();
+    type Error = EncoderError;
+
+    fn serialize_field<T: ?Sized + Serialize>(&mut self,
+                                              key: &'static str,
+                                              value: &T)
+                                              -> EncodeResult<Self::Ok> {
+        self.enc.state = NextKey(String::from(key));
+        value.serialize(&mut *self.enc)
+    }
+
+    fn end(self) -> EncodeResult<Self::Ok> {
+        if self.is_root {
+            self.enc.keys.pop();
+        }
+        Ok(())
+    }
+}
+
+pub struct StructVariantEncoder {}
+
+impl SerializeStructVariant for StructVariantEncoder {
+    type Ok = ();
+    type Error = EncoderError;
+
+    fn serialize_field<T: ?Sized + Serialize>(&mut self,
+                                              _key: &'static str,
+                                              _value: &T)
+                                              -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeStructVariant::serialize_field")
+    }
+
+    fn end(self) -> EncodeResult<Self::Ok> {
+        no_impl!("SerializeStructVariant::end")
+    }
+}
+
--- a/third_party/rust/winreg/src/lib.rs
+++ b/third_party/rust/winreg/src/lib.rs
@@ -99,17 +99,18 @@ use std::ptr;
 use std::slice;
 use std::fmt;
 use std::default::Default;
 use std::ffi::OsStr;
 use std::os::windows::ffi::OsStrExt;
 use std::mem::transmute;
 use std::io;
 use winapi::shared::winerror;
-use winapi::shared::minwindef::{HKEY, DWORD, BYTE, LPBYTE};
+pub use winapi::shared::minwindef::HKEY;
+use winapi::shared::minwindef::{DWORD, BYTE, LPBYTE};
 use winapi::um::winnt::{self, WCHAR};
 use winapi::um::winreg as winapi_reg;
 use enums::*;
 use types::{FromRegValue, ToRegValue};
 #[cfg(feature = "transactions")]
 use transaction::Transaction;
 
 macro_rules! werr {
@@ -177,16 +178,18 @@ impl fmt::Debug for RegValue {
 }
 
 /// Handle of opened registry key
 #[derive(Debug)]
 pub struct RegKey {
     hkey: HKEY,
 }
 
+unsafe impl Send for RegKey {}
+
 impl RegKey {
     /// Open one of predefined keys:
     ///
     /// * `HKEY_CLASSES_ROOT`
     /// * `HKEY_CURRENT_USER`
     /// * `HKEY_LOCAL_MACHINE`
     /// * `HKEY_USERS`
     /// * `HKEY_PERFORMANCE_DATA`
@@ -202,16 +205,31 @@ impl RegKey {
     /// # use winreg::RegKey;
     /// # use winreg::enums::*;
     /// let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
     /// ```
     pub fn predef(hkey: HKEY) -> RegKey {
         RegKey{ hkey: hkey }
     }
 
+    /// Return inner winapi HKEY of a key:
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// # use winreg::RegKey;
+    /// # use winreg::enums::*;
+    /// let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
+    /// let soft = hklm.open_subkey("SOFTWARE").unwrap();
+    /// let handle = soft.raw_handle();
+    /// ```
+    pub fn raw_handle(&self) -> HKEY {
+        self.hkey
+    }
+
     /// Open subkey with `KEY_READ` permissions.
     /// Will open another handle to itself if `path` is an empty string.
     /// To open with different permissions use `open_subkey_with_flags`.
     /// You can also use `create_subkey` to open with `KEY_ALL_ACCESS` permissions.
     ///
     /// # Examples
     ///
     /// ```no_run
@@ -437,17 +455,17 @@ impl RegKey {
     /// for (name, value) in system.enum_values().map(|x| x.unwrap()) {
     ///     println!("{} = {:?}", name, value);
     /// }
     /// ```
     pub fn enum_values(&self) -> EnumValues {
         EnumValues{key: self, index: 0}
     }
 
-    /// Delete key.Key names are not case sensitive. 
+    /// Delete key.Key names are not case sensitive.
     /// Cannot delete if it has subkeys.
     /// Use `delete_subkey_all` for that.
     ///
     /// # Examples
     ///
     /// ```no_run
     /// # use winreg::RegKey;
     /// # use winreg::enums::*;
@@ -473,17 +491,17 @@ impl RegKey {
         let c_path = to_utf16(path);
         match unsafe {
             winapi_reg::RegDeleteKeyTransactedW(
                 self.hkey,
                 c_path.as_ptr(), //The value of this parameter cannot be NULL.
                 0,
                 0,
                 t.handle,
-                ptr::null_mut(), 
+                ptr::null_mut(),
             ) as DWORD
         } {
             0 => Ok(()),
             err => werr!(err)
         }
     }
 
     /// Recursively delete subkey with all its subkeys and values.
@@ -902,16 +920,23 @@ extern crate serde_derive;
 mod test {
     extern crate rand;
     use super::*;
     use std::collections::HashMap;
     use self::rand::Rng;
     use std::ffi::{OsStr,OsString};
 
     #[test]
+    fn test_raw_handle() {
+        let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
+        let handle = hklm.raw_handle();
+        assert_eq!(HKEY_LOCAL_MACHINE, handle);
+    }
+
+    #[test]
     fn test_open_subkey_with_flags_query_info() {
         let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
         let win = hklm.open_subkey_with_flags("Software\\Microsoft\\Windows", KEY_READ).unwrap();
         assert!(win.query_info().is_ok());
         assert!(win.open_subkey_with_flags("CurrentVersion\\", KEY_READ).is_ok());
         assert!(hklm.open_subkey_with_flags("i\\just\\hope\\nobody\\created\\that\\key", KEY_READ).is_err());
     }