Changelog History
Page 2
-
v1.0.108 Changes
May 10, 2020Provide a
Serializer
impl that can write primitives and unit variants to a&mut fmt::Formatter
(#1705, thanks @jethrogb)use serde::Serialize;use std::fmt::{self, Display}; #[derive(Serialize)] #[serde(rename\_all = "kebab-case")]pub enum MessageType { StartRequest, EndRequest, }impl Display for MessageType { fn fmt(&self, f: &mut fmt::Formatter) -\> fmt::Result { self.serialize(f) } }
-
v1.0.107 Changes
May 08, 2020- ๐ Fix panic during macro expansion when using
serde(skip)
andserde(other)
in the same enum (#1804)
- ๐ Fix panic during macro expansion when using
-
v1.0.106 Changes
April 03, 2020 -
v1.0.105 Changes
March 18, 2020- ๐ Allow #[serde(borrow)] to work on non-standard
Cow
types (#1754, thanks @maciejhirsz)
- ๐ Allow #[serde(borrow)] to work on non-standard
-
v1.0.104 Changes
December 16, 2019- โช Revert stabilization of Serialize/Deserialize impls for
!
to account for rust-lang/rust#67224
- โช Revert stabilization of Serialize/Deserialize impls for
-
v1.0.103 Changes
November 25, 2019- ๐ Support deserializing untagged unit variants from formats that treat unit as None (#1668)
-
v1.0.102 Changes
October 27, 2019 -
v1.0.101 Changes
September 16, 2019Report errors on malformed serde attributes, like
#[serde(rename =)]
-- the compiler used to reject these itself, but when the compiler relaxed its requirements on attribute syntax these malformed attributes began silently being ignored by serde_deriveโ Eliminate unused variable warning when using skip_serializing inside a tuple variant of an adjacently tagged enum (#1617, thanks @arilotter)
๐ Support skip attribute inside of newtype variants (#1622, thanks @Xaeroxe)
-
v1.0.100 Changes
September 08, 2019Provide
serde::ser::StdError
andserde::de::StdError
which are either a re-export ofstd::error::Error
(if Serde's "std" feature is enabled) or a new identical trait (otherwise).#[cfg(feature = "std")]pub use std::error::Error as StdError; #[cfg(not(feature = "std"))]pub trait StdError: Debug + Display { fn source(&self) -\> Option\<&(StdError + 'static)\> { None } }
๐ Serde's error traits
serde::ser::Error
andserde::de::Error
requirestd::error::Error
as a supertrait, but only when Serde is built with "std" enabled. Data formats that don't care about no_std support should generally provide their error types with astd::error::Error
impl directly:#[derive(Debug)]struct MySerError {...}impl serde::ser::Error for MySerError {...}impl std::fmt::Display for MySerError {...}// We don't support no\_std!impl std::error::Error for MySerError {}
Data formats that do support no_std may either have a "std" feature of their own as has been required in the past:
[features]std = ["serde/std"] #[cfg(feature = "std")]impl std::error::Error for MySerError {}
... or else now may provide the std Error impl unconditionally via Serde's re-export:
impl serde::ser::StdError for MySerError {}
-
v1.0.99 Changes
August 16, 2019โก๏ธ Update Syn dependency to 1.0.
Note: This raises the minimum required compiler version for serde_derive from rustc 1.15 to rustc 1.31. The minimum required compiler version for serde remains at rustc 1.13.