Skip to content

Commit

Permalink
Merge #438
Browse files Browse the repository at this point in the history
438: Bump serde_with to v1.13.0 r=jonasbb a=jonasbb

* Update changelog
* Include tests when publishing

bors merge

Co-authored-by: Jonas Bushart <jonas@bushart.org>
  • Loading branch information
bors[bot] and jonasbb authored Apr 22, 2022
2 parents 88ffa73 + 948a383 commit 6fe1198
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 33 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Add this to your `Cargo.toml`:

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

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

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

## License

Expand Down
13 changes: 13 additions & 0 deletions serde_with/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.13.0] - 2022-04-23

### Added

* Added support for `indexmap::IndexMap` and `indexmap::IndexSet` types. #431, #436

Both types are now compatible with these functions: `maps_duplicate_key_is_error`, `maps_first_key_wins`, `sets_duplicate_value_is_error`, `sets_last_value_wins`.
`serde_as` integration is provided by implementing both `SerializeAs` and `DeserializeAs` for both types.
`IndexMap`s can also be serialized as a list of types via the `serde_as(as = "Vec<(_, _)>")` annotation.

All implementations are gated behind the `indexmap` feature.

Thanks to @jgrund for providing parts of the implementation.

## [1.12.1] - 2022-04-07

Expand Down
5 changes: 2 additions & 3 deletions serde_with/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ authors = [
"Marcin Kaźmierczak",
]
name = "serde_with"
version = "1.12.1"
rust-version = "1.46"
version = "1.13.0"

categories = ["encoding"]
description = "Custom de/serialization functions for Rust's serde"
Expand All @@ -17,7 +17,7 @@ license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/jonasbb/serde_with"

include = ["src/**/*", "LICENSE-*", "README.*", "CHANGELOG.md"]
include = ["src/**/*", "tests/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]

[badges]
maintenance = {status = "actively-developed"}
Expand Down Expand Up @@ -103,4 +103,3 @@ rustdoc-args = [
# https://github.com/rust-lang/rust/pull/84176
"-Zunstable-options", "--generate-link-to-definition"
]

30 changes: 15 additions & 15 deletions serde_with/src/lib.rs
Original file line number Diff line number Diff line change
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.12.1")]
#![doc(html_root_url = "https://docs.rs/serde_with/1.13.0")]
#![cfg_attr(docsrs, feature(doc_cfg))]
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
Expand Down Expand Up @@ -66,7 +66,7 @@
//!
//! ```toml
//! [dependencies.serde_with]
//! version = "1.12.1"
//! version = "1.13.0"
//! features = [ "..." ]
//! ```
//!
Expand Down Expand Up @@ -243,15 +243,15 @@
//! # }
//! ```
//!
//! [`DisplayFromStr`]: https://docs.rs/serde_with/1.12.1/serde_with/struct.DisplayFromStr.html
//! [`with_prefix!`]: https://docs.rs/serde_with/1.12.1/serde_with/macro.with_prefix.html
//! [display_fromstr]: https://docs.rs/serde_with/1.12.1/serde_with/rust/display_fromstr/index.html
//! [feature flags]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
//! [skip_serializing_none]: https://docs.rs/serde_with/1.12.1/serde_with/attr.skip_serializing_none.html
//! [StringWithSeparator]: https://docs.rs/serde_with/1.12.1/serde_with/rust/struct.StringWithSeparator.html
//! [user guide]: https://docs.rs/serde_with/1.12.1/serde_with/guide/index.html
//! [`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
//! [with-annotation]: https://serde.rs/field-attrs.html#with
//! [as-annotation]: https://docs.rs/serde_with/1.12.1/serde_with/guide/serde_as/index.html
//! [as-annotation]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html

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

Expand Down Expand Up @@ -865,7 +865,7 @@ pub struct BytesOrString;
/// ```
///
/// [`chrono::Duration`]: chrono_crate::Duration
/// [feature flag]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
#[derive(Copy, Clone, Debug, Default)]
pub struct DurationSeconds<
FORMAT: formats::Format = u64,
Expand Down Expand Up @@ -991,7 +991,7 @@ pub struct DurationSeconds<
/// ```
///
/// [`chrono::Duration`]: chrono_crate::Duration
/// [feature flag]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
#[derive(Copy, Clone, Debug, Default)]
pub struct DurationSecondsWithFrac<
FORMAT: formats::Format = f64,
Expand Down Expand Up @@ -1188,7 +1188,7 @@ pub struct DurationNanoSecondsWithFrac<
///
/// [`SystemTime`]: std::time::SystemTime
/// [DateTime]: chrono_crate::DateTime
/// [feature flag]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
#[derive(Copy, Clone, Debug, Default)]
pub struct TimestampSeconds<
FORMAT: formats::Format = i64,
Expand Down Expand Up @@ -1320,7 +1320,7 @@ pub struct TimestampSeconds<
/// [`SystemTime`]: std::time::SystemTime
/// [DateTime]: chrono_crate::DateTime
/// [NaiveDateTime]: chrono_crate::NaiveDateTime
/// [feature flag]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
#[derive(Copy, Clone, Debug, Default)]
pub struct TimestampSecondsWithFrac<
FORMAT: formats::Format = f64,
Expand Down
12 changes: 10 additions & 2 deletions serde_with_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
authors = ["Jonas Bushart"]
name = "serde_with_macros"
version = "1.5.2"
rust-version = "1.46"
version = "1.5.2"

categories = ["encoding"]
description = "proc-macro library for serde_with"
Expand All @@ -13,7 +13,15 @@ license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/jonasbb/serde_with/"

include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]
include = [
"src/**/*",
"tests/**/*",
# These tests are a bit more volatile as future compiler upgrade might break them
"!tests/compile-fail/**",
"LICENSE-*",
"README.md",
"CHANGELOG.md",
]

[lib]
proc-macro = true
Expand Down
8 changes: 4 additions & 4 deletions serde_with_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ fn field_has_attribute(field: &Field, namespace: &str, name: &str) -> bool {
/// }
/// ```
///
/// [`serde_as`]: https://docs.rs/serde_with/1.12.1/serde_with/guide/index.html
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/1.12.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
/// [`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
#[proc_macro_attribute]
pub fn serde_as(args: TokenStream, input: TokenStream) -> TokenStream {
#[derive(FromMeta, Debug)]
Expand Down Expand Up @@ -845,7 +845,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.12.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
/// [serde-as-crate]: https://docs.rs/serde_with/1.13.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 @@ -957,7 +957,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.12.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
/// [serde-as-crate]: https://docs.rs/serde_with/1.13.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 6fe1198

Please sign in to comment.