Skip to content

Commit

Permalink
Merge #463
Browse files Browse the repository at this point in the history
463: Bump `serde_with` version to 1.14.0 r=jonasbb a=jonasbb

* Cleanup some doc links
* Bump some dev-dependencies

Co-authored-by: Jonas Bushart <jonas@bushart.org>
  • Loading branch information
bors[bot] and jonasbb committed May 29, 2022
2 parents d3140e1 + 8773ac1 commit 8c59954
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 33 deletions.
18 changes: 9 additions & 9 deletions README.md
Expand Up @@ -34,7 +34,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies.serde_with]
version = "1.13.0"
version = "1.14.0"
features = [ "..." ]
```

Expand Down Expand Up @@ -158,15 +158,15 @@ Foo {
}
```

[`DisplayFromStr`]: https://docs.rs/serde_with/1.13.0/serde_with/struct.DisplayFromStr.html
[`with_prefix!`]: https://docs.rs/serde_with/1.13.0/serde_with/macro.with_prefix.html
[display_fromstr]: https://docs.rs/serde_with/1.13.0/serde_with/rust/display_fromstr/index.html
[feature flags]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
[skip_serializing_none]: https://docs.rs/serde_with/1.13.0/serde_with/attr.skip_serializing_none.html
[StringWithSeparator]: https://docs.rs/serde_with/1.13.0/serde_with/rust/struct.StringWithSeparator.html
[user guide]: https://docs.rs/serde_with/1.13.0/serde_with/guide/index.html
[`DisplayFromStr`]: https://docs.rs/serde_with/1.14.0/serde_with/struct.DisplayFromStr.html
[`with_prefix!`]: https://docs.rs/serde_with/1.14.0/serde_with/macro.with_prefix.html
[display_fromstr]: https://docs.rs/serde_with/1.14.0/serde_with/rust/display_fromstr/index.html
[feature flags]: https://docs.rs/serde_with/1.14.0/serde_with/guide/feature_flags/index.html
[skip_serializing_none]: https://docs.rs/serde_with/1.14.0/serde_with/attr.skip_serializing_none.html
[StringWithSeparator]: https://docs.rs/serde_with/1.14.0/serde_with/rust/struct.StringWithSeparator.html
[user guide]: https://docs.rs/serde_with/1.14.0/serde_with/guide/index.html
[with-annotation]: https://serde.rs/field-attrs.html#with
[as-annotation]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html
[as-annotation]: https://docs.rs/serde_with/1.14.0/serde_with/guide/serde_as/index.html

## License

Expand Down
2 changes: 2 additions & 0 deletions serde_with/CHANGELOG.md
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.14.0] - 2022-05-29

### Added

* Add support for `time` crate v0.3 #450
Expand Down
4 changes: 2 additions & 2 deletions serde_with/Cargo.toml
Expand Up @@ -6,7 +6,7 @@ authors = [
]
name = "serde_with"
rust-version = "1.53"
version = "1.13.0"
version = "1.14.0"

categories = ["encoding"]
description = "Custom de/serialization functions for Rust's serde"
Expand Down Expand Up @@ -51,7 +51,7 @@ glob = "0.3.0"
mime = "0.3.16"
pretty_assertions = "1.0.0"
regex = {version = "1.3.9", default-features = false, features = ["std"]}
rmp-serde = "0.15.5"
rmp-serde = "1.1.0"
ron = "0.7"
rustversion = "1.0.0"
serde_json = {version = "1.0.25", features = ["preserve_order"]}
Expand Down
4 changes: 3 additions & 1 deletion serde_with/src/de/mod.rs
Expand Up @@ -21,7 +21,7 @@ use super::*;
/// # Differences to [`Deserialize`]
///
/// The trait is only required for container-like types or types implementing specific conversion functions.
/// Container-like types are [`Vec`][], [`BTreeMap`][], but also [`Option`][] and [`Box`][].
/// Container-like types are [`Vec`], [`BTreeMap`], but also [`Option`] and [`Box`].
/// Conversion types deserialize into a different Rust type.
/// For example, [`DisplayFromStr`] uses the [`FromStr`] trait after deserializing a string and [`DurationSeconds`] creates a [`Duration`] from either String or integer values.
///
Expand Down Expand Up @@ -100,9 +100,11 @@ use super::*;
/// # assert_eq!(false, serde_json::from_str::<S>(r#""false""#).unwrap().0);
/// # }
/// ```
/// [`Box`]: std::boxed::Box
/// [`BTreeMap`]: std::collections::BTreeMap
/// [`Duration`]: std::time::Duration
/// [`FromStr`]: std::str::FromStr
/// [`Vec`]: std::vec::Vec
/// [impl-deserialize]: https://serde.rs/impl-deserialize.html
pub trait DeserializeAs<'de, T>: Sized {
/// Deserialize this value from the given Serde deserializer.
Expand Down
31 changes: 16 additions & 15 deletions serde_with/src/lib.rs
Expand Up @@ -25,7 +25,7 @@
#![doc(test(attr(warn(rust_2018_idioms))))]
// Not needed for 2018 edition and conflicts with `rust_2018_idioms`
#![doc(test(no_crate_inject))]
#![doc(html_root_url = "https://docs.rs/serde_with/1.13.0")]
#![doc(html_root_url = "https://docs.rs/serde_with/1.14.0")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![allow(
// clippy is broken and shows wrong warnings
Expand Down Expand Up @@ -72,7 +72,7 @@
//!
//! ```toml
//! [dependencies.serde_with]
//! version = "1.13.0"
//! version = "1.14.0"
//! features = [ "..." ]
//! ```
//!
Expand Down Expand Up @@ -251,15 +251,15 @@
//! # }
//! ```
//!
//! [`DisplayFromStr`]: https://docs.rs/serde_with/1.13.0/serde_with/struct.DisplayFromStr.html
//! [`with_prefix!`]: https://docs.rs/serde_with/1.13.0/serde_with/macro.with_prefix.html
//! [display_fromstr]: https://docs.rs/serde_with/1.13.0/serde_with/rust/display_fromstr/index.html
//! [feature flags]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
//! [skip_serializing_none]: https://docs.rs/serde_with/1.13.0/serde_with/attr.skip_serializing_none.html
//! [StringWithSeparator]: https://docs.rs/serde_with/1.13.0/serde_with/rust/struct.StringWithSeparator.html
//! [user guide]: https://docs.rs/serde_with/1.13.0/serde_with/guide/index.html
//! [`DisplayFromStr`]: https://docs.rs/serde_with/1.14.0/serde_with/struct.DisplayFromStr.html
//! [`with_prefix!`]: https://docs.rs/serde_with/1.14.0/serde_with/macro.with_prefix.html
//! [display_fromstr]: https://docs.rs/serde_with/1.14.0/serde_with/rust/display_fromstr/index.html
//! [feature flags]: https://docs.rs/serde_with/1.14.0/serde_with/guide/feature_flags/index.html
//! [skip_serializing_none]: https://docs.rs/serde_with/1.14.0/serde_with/attr.skip_serializing_none.html
//! [StringWithSeparator]: https://docs.rs/serde_with/1.14.0/serde_with/rust/struct.StringWithSeparator.html
//! [user guide]: https://docs.rs/serde_with/1.14.0/serde_with/guide/index.html
//! [with-annotation]: https://serde.rs/field-attrs.html#with
//! [as-annotation]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html
//! [as-annotation]: https://docs.rs/serde_with/1.14.0/serde_with/guide/serde_as/index.html

extern crate alloc;
#[doc(hidden)]
Expand Down Expand Up @@ -413,7 +413,7 @@ impl Separator for CommaSeparator {
/// # }
/// ```
///
/// [serde_as]: https://docs.rs/serde_with/1.13.0/serde_with/attr.serde_as.html
/// [serde_as]: https://docs.rs/serde_with/1.14.0/serde_with/attr.serde_as.html
#[derive(Copy, Clone, Debug, Default)]
pub struct As<T: ?Sized>(PhantomData<T>);

Expand Down Expand Up @@ -743,6 +743,7 @@ pub struct DefaultOnNull<T = Same>(PhantomData<T>);
/// assert_eq!("✨Works!".as_bytes(), &*a.bytes_or_string);
/// # }
/// ```
/// [`String`]: std::string::String
#[derive(Copy, Clone, Debug, Default)]
pub struct BytesOrString;

Expand Down Expand Up @@ -882,7 +883,7 @@ pub struct BytesOrString;
/// ```
///
/// [`chrono::Duration`]: chrono_crate::Duration
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
/// [feature flag]: https://docs.rs/serde_with/1.14.0/serde_with/guide/feature_flags/index.html
#[derive(Copy, Clone, Debug, Default)]
pub struct DurationSeconds<
FORMAT: formats::Format = u64,
Expand Down Expand Up @@ -1011,7 +1012,7 @@ pub struct DurationSeconds<
/// ```
///
/// [`chrono::Duration`]: chrono_crate::Duration
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
/// [feature flag]: https://docs.rs/serde_with/1.14.0/serde_with/guide/feature_flags/index.html
#[derive(Copy, Clone, Debug, Default)]
pub struct DurationSecondsWithFrac<
FORMAT: formats::Format = f64,
Expand Down Expand Up @@ -1213,7 +1214,7 @@ pub struct DurationNanoSecondsWithFrac<
///
/// [`SystemTime`]: std::time::SystemTime
/// [DateTime]: chrono_crate::DateTime
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
/// [feature flag]: https://docs.rs/serde_with/1.14.0/serde_with/guide/feature_flags/index.html
#[derive(Copy, Clone, Debug, Default)]
pub struct TimestampSeconds<
FORMAT: formats::Format = i64,
Expand Down Expand Up @@ -1350,7 +1351,7 @@ pub struct TimestampSeconds<
/// [`SystemTime`]: std::time::SystemTime
/// [DateTime]: chrono_crate::DateTime
/// [NaiveDateTime]: chrono_crate::NaiveDateTime
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
/// [feature flag]: https://docs.rs/serde_with/1.14.0/serde_with/guide/feature_flags/index.html
#[derive(Copy, Clone, Debug, Default)]
pub struct TimestampSecondsWithFrac<
FORMAT: formats::Format = f64,
Expand Down
4 changes: 3 additions & 1 deletion serde_with/src/ser/mod.rs
Expand Up @@ -22,7 +22,7 @@ use super::*;
/// # Differences to [`Serialize`]
///
/// The trait is only required for container-like types or types implementing specific conversion functions.
/// Container-like types are [`Vec`][], [`BTreeMap`][], but also [`Option`][] and [`Box`][].
/// Container-like types are [`Vec`], [`BTreeMap`], but also [`Option`] and [`Box`].
/// Conversion types serialize into a different serde data type.
/// For example, [`DisplayFromStr`] uses the [`Display`] trait to serialize a String and [`DurationSeconds`] converts a [`Duration`] into either String or integer values.
///
Expand Down Expand Up @@ -98,9 +98,11 @@ use super::*;
/// # }
/// ```
///
/// [`Box`]: std::boxed::Box
/// [`BTreeMap`]: std::collections::BTreeMap
/// [`Display`]: std::fmt::Display
/// [`Duration`]: std::time::Duration
/// [`Vec`]: std::vec::Vec
/// [impl-serialize]: https://serde.rs/impl-serialize.html
pub trait SerializeAs<T: ?Sized> {
/// Serialize this value into the given Serde serializer.
Expand Down
2 changes: 1 addition & 1 deletion serde_with/tests/serde_as/enum_map.rs
Expand Up @@ -412,7 +412,7 @@ fn rmp_round_trip() {
};

let rmp = rmp_serde::to_vec(&values).unwrap();
expect_test::expect![[r#"\x91\x88\xa3Int{\xa6String\xa6FooBar\xa3Int\xcd\x01\xc8\xa6String\xa3XXX\xa4Unit\xc0\xa5Tuple\x93\x01\xa6Middle\xc2\xa6Struct\x93\xcd\x02\x9a\xa3BBB\xc3\xa2Ip\x92\x81\x00\x94\x7f\x00\x00\x01\x81\x01\xdc\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00ww\xcc\xde\xcc\xad\xcc\xbe\xcc\xef"#]]
expect_test::expect![[r#"\x91\x88\xa3Int{\xa6String\xa6FooBar\xa3Int\xcd\x01\xc8\xa6String\xa3XXX\xa4Unit\xc0\xa5Tuple\x93\x01\xa6Middle\xc2\xa6Struct\x93\xcd\x02\x9a\xa3BBB\xc3\xa2Ip\x92\x81\xa2V4\x94\x7f\x00\x00\x01\x81\xa2V6\xdc\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00ww\xcc\xde\xcc\xad\xcc\xbe\xcc\xef"#]]
.assert_eq(&bytes_debug_readable(&rmp));
let deser_values: VecEnumValues = rmp_serde::from_read(&*rmp).unwrap();
assert_eq!(values, deser_values);
Expand Down
8 changes: 4 additions & 4 deletions serde_with_macros/src/lib.rs
Expand Up @@ -476,8 +476,8 @@ fn field_has_attribute(field: &Field, namespace: &str, name: &str) -> bool {
/// }
/// ```
///
/// [`serde_as`]: https://docs.rs/serde_with/1.13.0/serde_with/guide/index.html
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
/// [`serde_as`]: https://docs.rs/serde_with/1.14.0/serde_with/guide/index.html
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/1.14.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
#[proc_macro_attribute]
pub fn serde_as(args: TokenStream, input: TokenStream) -> TokenStream {
#[derive(FromMeta, Debug)]
Expand Down Expand Up @@ -843,7 +843,7 @@ fn has_type_embedded(type_: &Type, embedded_type: &syn::Ident) -> bool {
/// [`Display`]: std::fmt::Display
/// [`FromStr`]: std::str::FromStr
/// [cargo-toml-rename]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
/// [serde-as-crate]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
/// [serde-as-crate]: https://docs.rs/serde_with/1.14.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
/// [serde-crate]: https://serde.rs/container-attrs.html#crate
#[proc_macro_derive(DeserializeFromStr, attributes(serde_with))]
pub fn derive_deserialize_fromstr(item: TokenStream) -> TokenStream {
Expand Down Expand Up @@ -955,7 +955,7 @@ fn deserialize_fromstr(mut input: DeriveInput, serde_with_crate_path: Path) -> T
/// [`Display`]: std::fmt::Display
/// [`FromStr`]: std::str::FromStr
/// [cargo-toml-rename]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
/// [serde-as-crate]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
/// [serde-as-crate]: https://docs.rs/serde_with/1.14.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
/// [serde-crate]: https://serde.rs/container-attrs.html#crate
#[proc_macro_derive(SerializeDisplay, attributes(serde_with))]
pub fn derive_serialize_display(item: TokenStream) -> TokenStream {
Expand Down

0 comments on commit 8c59954

Please sign in to comment.