From 0a32cea26e70639b3569deb246338cff71d59bc6 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sat, 23 Jan 2016 16:07:50 -0800 Subject: [PATCH 1/2] feat(impls): Allow options to be deserialized from units --- serde/src/de/impls.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 1e5f5770..ef696484 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -283,6 +283,13 @@ impl< > Visitor for OptionVisitor { type Value = Option; + #[inline] + fn visit_unit(&mut self) -> Result, E> + where E: Error, + { + Ok(None) + } + #[inline] fn visit_none(&mut self) -> Result, E> where E: Error, From a5d0703e44867a97216bec66280c65365b28b67e Mon Sep 17 00:00:00 2001 From: Simon Persson Date: Sat, 23 Jan 2016 14:35:11 +0100 Subject: [PATCH 2/2] Bump clippy dependency to compile on 1.8. --- serde/Cargo.toml | 4 ++-- serde_codegen/Cargo.toml | 4 ++-- serde_macros/Cargo.toml | 4 ++-- serde_tests/Cargo.toml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/serde/Cargo.toml b/serde/Cargo.toml index 31328943..2c2cef80 100644 --- a/serde/Cargo.toml +++ b/serde/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde" -version = "0.6.10" +version = "0.6.11" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A generic serialization/deserialization framework" @@ -17,5 +17,5 @@ num-impls = ["num-bigint", "num-complex", "num-rational"] num-rational = ["num/rational"] [dependencies] -clippy = { version = "^0.0.36", optional = true } +clippy = { version = "^0.0.37", optional = true } num = { version = "^0.1.27", default-features = false } diff --git a/serde_codegen/Cargo.toml b/serde_codegen/Cargo.toml index 1f991b22..ac438582 100644 --- a/serde_codegen/Cargo.toml +++ b/serde_codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_codegen" -version = "0.6.10" +version = "0.6.11" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "Macros to auto-generate implementations for the serde framework" @@ -20,7 +20,7 @@ syntex = { version = "^0.26.0", optional = true } [dependencies] aster = { version = "^0.10.0", default-features = false } -clippy = { version = "^0.0.36", optional = true } +clippy = { version = "^0.0.37", optional = true } quasi = { version = "^0.4.0", default-features = false } quasi_macros = { version = "^0.4.0", optional = true } syntex = { version = "^0.26.0", optional = true } diff --git a/serde_macros/Cargo.toml b/serde_macros/Cargo.toml index a2ebb428..92ee340b 100644 --- a/serde_macros/Cargo.toml +++ b/serde_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_macros" -version = "0.6.10" +version = "0.6.11" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "Macros to auto-generate implementations for the serde framework" @@ -13,7 +13,7 @@ name = "serde_macros" plugin = true [dependencies] -clippy = "^0.0.36" +clippy = "^0.0.37" serde_codegen = { version = "^0.6.10", path = "../serde_codegen", default-features = false, features = ["nightly"] } [dev-dependencies] diff --git a/serde_tests/Cargo.toml b/serde_tests/Cargo.toml index 64eef6b5..dc5b5421 100644 --- a/serde_tests/Cargo.toml +++ b/serde_tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_tests" -version = "0.6.2" +version = "0.6.3" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A generic serialization/deserialization framework" @@ -25,7 +25,7 @@ serde = { version = "*", path = "../serde", features = ["num-impls"] } syntex = "^0.26.0" [dependencies] -clippy = { version = "^0.0.36", optional = true } +clippy = { version = "^0.0.37", optional = true } [[test]] name = "test"