Compare commits

...

6 Commits

Author SHA1 Message Date
David Tolnay 1b763da529 Release 0.9.13 2017-04-05 15:03:37 -07:00
David Tolnay b7d6c5d9f7 Remove no_std special case in forward_to_deserialize 2017-04-05 15:01:55 -07:00
David Tolnay bfabaf3789 Merge pull request #838 from serde-rs/winstr
Deserialize OsString on Windows
2017-04-04 11:33:42 -07:00
David Tolnay cf6c4ab7ec Deserialize OsString on Windows 2017-04-04 11:19:24 -07:00
David Tolnay 8eb50186e0 Merge pull request #831 from serde-rs/derivepath
Use the live serde_derive for serde doc tests
2017-03-30 22:55:33 -07:00
David Tolnay 7d985ff3fd Use the live serde_derive for serde doc tests
This is required as both are updated to Deserialize<'de> together.
2017-03-30 22:45:15 -07:00
5 changed files with 23 additions and 22 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
[package]
name = "serde"
version = "0.9.12"
version = "0.9.13"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
license = "MIT/Apache-2.0"
description = "A generic serialization/deserialization framework"
@@ -29,7 +29,7 @@ unstable-testing = ["unstable", "std"]
playground = ["serde_derive"]
[dependencies]
serde_derive = { version = "0.9", optional = true }
serde_derive = { version = "0.9", optional = true, path = "../serde_derive" }
[dev-dependencies]
serde_derive = "0.9"
serde_derive = { version = "0.9", path = "../serde_derive" }
+17 -1
View File
@@ -1009,7 +1009,23 @@ impl Visitor for OsStringVisitor {
variant.visit_newtype().map(OsString::from_vec)
}
(OsStringKind::Windows, _) => {
Err(Error::custom("cannot deserialize windows os string on unix"))
Err(Error::custom("cannot deserialize Windows OS string on Unix"))
}
}
}
#[cfg(windows)]
fn visit_enum<V>(self, visitor: V) -> Result<OsString, V::Error>
where V: EnumVisitor,
{
use std::os::windows::ffi::OsStringExt;
match try!(visitor.visit_variant()) {
(OsStringKind::Windows, variant) => {
variant.visit_newtype::<Vec<u16>>().map(|vec| OsString::from_wide(&vec))
}
(OsStringKind::Unix, _) => {
Err(Error::custom("cannot deserialize Unix OS string on Windows"))
}
}
}
+1 -16
View File
@@ -1,24 +1,9 @@
#[cfg(feature = "std")]
#[doc(hidden)]
#[macro_export]
macro_rules! forward_to_deserialize_method {
($func:ident($($arg:ty),*)) => {
#[inline]
fn $func<__V>(self, $(_: $arg,)* visitor: __V) -> ::std::result::Result<__V::Value, Self::Error>
where __V: $crate::de::Visitor
{
self.deserialize(visitor)
}
};
}
#[cfg(not(feature = "std"))]
#[doc(hidden)]
#[macro_export]
macro_rules! forward_to_deserialize_method {
($func:ident($($arg:ty),*)) => {
#[inline]
fn $func<__V>(self, $(_: $arg,)* visitor: __V) -> ::core::result::Result<__V::Value, Self::Error>
fn $func<__V>(self, $(_: $arg,)* visitor: __V) -> $crate::export::Result<__V::Value, Self::Error>
where __V: $crate::de::Visitor
{
self.deserialize(visitor)
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "serde_derive"
version = "0.9.12"
version = "0.9.13"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
license = "MIT/Apache-2.0"
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "serde_test"
version = "0.9.12"
version = "0.9.13"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
license = "MIT/Apache-2.0"
description = "Token De/Serializer for testing De/Serialize implementations"