Skip to content

Commit 6fe1198

Browse files
bors[bot]jonasbb
andauthored
Merge #438
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 <[email protected]>
2 parents 88ffa73 + 948a383 commit 6fe1198

File tree

6 files changed

+53
-33
lines changed

6 files changed

+53
-33
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Add this to your `Cargo.toml`:
3434

3535
```toml
3636
[dependencies.serde_with]
37-
version = "1.12.1"
37+
version = "1.13.0"
3838
features = [ "..." ]
3939
```
4040

@@ -156,15 +156,15 @@ Foo {
156156
}
157157
```
158158

159-
[`DisplayFromStr`]: https://docs.rs/serde_with/1.12.1/serde_with/struct.DisplayFromStr.html
160-
[`with_prefix!`]: https://docs.rs/serde_with/1.12.1/serde_with/macro.with_prefix.html
161-
[display_fromstr]: https://docs.rs/serde_with/1.12.1/serde_with/rust/display_fromstr/index.html
162-
[feature flags]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
163-
[skip_serializing_none]: https://docs.rs/serde_with/1.12.1/serde_with/attr.skip_serializing_none.html
164-
[StringWithSeparator]: https://docs.rs/serde_with/1.12.1/serde_with/rust/struct.StringWithSeparator.html
165-
[user guide]: https://docs.rs/serde_with/1.12.1/serde_with/guide/index.html
159+
[`DisplayFromStr`]: https://docs.rs/serde_with/1.13.0/serde_with/struct.DisplayFromStr.html
160+
[`with_prefix!`]: https://docs.rs/serde_with/1.13.0/serde_with/macro.with_prefix.html
161+
[display_fromstr]: https://docs.rs/serde_with/1.13.0/serde_with/rust/display_fromstr/index.html
162+
[feature flags]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
163+
[skip_serializing_none]: https://docs.rs/serde_with/1.13.0/serde_with/attr.skip_serializing_none.html
164+
[StringWithSeparator]: https://docs.rs/serde_with/1.13.0/serde_with/rust/struct.StringWithSeparator.html
165+
[user guide]: https://docs.rs/serde_with/1.13.0/serde_with/guide/index.html
166166
[with-annotation]: https://serde.rs/field-attrs.html#with
167-
[as-annotation]: https://docs.rs/serde_with/1.12.1/serde_with/guide/serde_as/index.html
167+
[as-annotation]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html
168168

169169
## License
170170

serde_with/CHANGELOG.md

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

8+
## [1.13.0] - 2022-04-23
9+
10+
### Added
11+
12+
* Added support for `indexmap::IndexMap` and `indexmap::IndexSet` types. #431, #436
13+
14+
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`.
15+
`serde_as` integration is provided by implementing both `SerializeAs` and `DeserializeAs` for both types.
16+
`IndexMap`s can also be serialized as a list of types via the `serde_as(as = "Vec<(_, _)>")` annotation.
17+
18+
All implementations are gated behind the `indexmap` feature.
19+
20+
Thanks to @jgrund for providing parts of the implementation.
821

922
## [1.12.1] - 2022-04-07
1023

serde_with/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ authors = [
55
"Marcin Kaźmierczak",
66
]
77
name = "serde_with"
8-
version = "1.12.1"
98
rust-version = "1.46"
9+
version = "1.13.0"
1010

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

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

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

serde_with/src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#![doc(test(attr(warn(rust_2018_idioms))))]
2626
// Not needed for 2018 edition and conflicts with `rust_2018_idioms`
2727
#![doc(test(no_crate_inject))]
28-
#![doc(html_root_url = "https://docs.rs/serde_with/1.12.1")]
28+
#![doc(html_root_url = "https://docs.rs/serde_with/1.13.0")]
2929
#![cfg_attr(docsrs, feature(doc_cfg))]
3030
// clippy is broken and shows wrong warnings
3131
// clippy on stable does not know yet about the lint name
@@ -66,7 +66,7 @@
6666
//!
6767
//! ```toml
6868
//! [dependencies.serde_with]
69-
//! version = "1.12.1"
69+
//! version = "1.13.0"
7070
//! features = [ "..." ]
7171
//! ```
7272
//!
@@ -243,15 +243,15 @@
243243
//! # }
244244
//! ```
245245
//!
246-
//! [`DisplayFromStr`]: https://docs.rs/serde_with/1.12.1/serde_with/struct.DisplayFromStr.html
247-
//! [`with_prefix!`]: https://docs.rs/serde_with/1.12.1/serde_with/macro.with_prefix.html
248-
//! [display_fromstr]: https://docs.rs/serde_with/1.12.1/serde_with/rust/display_fromstr/index.html
249-
//! [feature flags]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
250-
//! [skip_serializing_none]: https://docs.rs/serde_with/1.12.1/serde_with/attr.skip_serializing_none.html
251-
//! [StringWithSeparator]: https://docs.rs/serde_with/1.12.1/serde_with/rust/struct.StringWithSeparator.html
252-
//! [user guide]: https://docs.rs/serde_with/1.12.1/serde_with/guide/index.html
246+
//! [`DisplayFromStr`]: https://docs.rs/serde_with/1.13.0/serde_with/struct.DisplayFromStr.html
247+
//! [`with_prefix!`]: https://docs.rs/serde_with/1.13.0/serde_with/macro.with_prefix.html
248+
//! [display_fromstr]: https://docs.rs/serde_with/1.13.0/serde_with/rust/display_fromstr/index.html
249+
//! [feature flags]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
250+
//! [skip_serializing_none]: https://docs.rs/serde_with/1.13.0/serde_with/attr.skip_serializing_none.html
251+
//! [StringWithSeparator]: https://docs.rs/serde_with/1.13.0/serde_with/rust/struct.StringWithSeparator.html
252+
//! [user guide]: https://docs.rs/serde_with/1.13.0/serde_with/guide/index.html
253253
//! [with-annotation]: https://serde.rs/field-attrs.html#with
254-
//! [as-annotation]: https://docs.rs/serde_with/1.12.1/serde_with/guide/serde_as/index.html
254+
//! [as-annotation]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html
255255
256256
#[doc(hidden)]
257257
pub extern crate serde;
@@ -399,7 +399,7 @@ impl Separator for CommaSeparator {
399399
/// # }
400400
/// ```
401401
///
402-
/// [serde_as]: https://docs.rs/serde_with/1.12.1/serde_with/attr.serde_as.html
402+
/// [serde_as]: https://docs.rs/serde_with/1.13.0/serde_with/attr.serde_as.html
403403
#[derive(Copy, Clone, Debug, Default)]
404404
pub struct As<T: ?Sized>(PhantomData<T>);
405405

@@ -865,7 +865,7 @@ pub struct BytesOrString;
865865
/// ```
866866
///
867867
/// [`chrono::Duration`]: chrono_crate::Duration
868-
/// [feature flag]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
868+
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
869869
#[derive(Copy, Clone, Debug, Default)]
870870
pub struct DurationSeconds<
871871
FORMAT: formats::Format = u64,
@@ -991,7 +991,7 @@ pub struct DurationSeconds<
991991
/// ```
992992
///
993993
/// [`chrono::Duration`]: chrono_crate::Duration
994-
/// [feature flag]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
994+
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
995995
#[derive(Copy, Clone, Debug, Default)]
996996
pub struct DurationSecondsWithFrac<
997997
FORMAT: formats::Format = f64,
@@ -1188,7 +1188,7 @@ pub struct DurationNanoSecondsWithFrac<
11881188
///
11891189
/// [`SystemTime`]: std::time::SystemTime
11901190
/// [DateTime]: chrono_crate::DateTime
1191-
/// [feature flag]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
1191+
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
11921192
#[derive(Copy, Clone, Debug, Default)]
11931193
pub struct TimestampSeconds<
11941194
FORMAT: formats::Format = i64,
@@ -1320,7 +1320,7 @@ pub struct TimestampSeconds<
13201320
/// [`SystemTime`]: std::time::SystemTime
13211321
/// [DateTime]: chrono_crate::DateTime
13221322
/// [NaiveDateTime]: chrono_crate::NaiveDateTime
1323-
/// [feature flag]: https://docs.rs/serde_with/1.12.1/serde_with/guide/feature_flags/index.html
1323+
/// [feature flag]: https://docs.rs/serde_with/1.13.0/serde_with/guide/feature_flags/index.html
13241324
#[derive(Copy, Clone, Debug, Default)]
13251325
pub struct TimestampSecondsWithFrac<
13261326
FORMAT: formats::Format = f64,

serde_with_macros/Cargo.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
authors = ["Jonas Bushart"]
33
name = "serde_with_macros"
4-
version = "1.5.2"
54
rust-version = "1.46"
5+
version = "1.5.2"
66

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

16-
include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]
16+
include = [
17+
"src/**/*",
18+
"tests/**/*",
19+
# These tests are a bit more volatile as future compiler upgrade might break them
20+
"!tests/compile-fail/**",
21+
"LICENSE-*",
22+
"README.md",
23+
"CHANGELOG.md",
24+
]
1725

1826
[lib]
1927
proc-macro = true

serde_with_macros/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ fn field_has_attribute(field: &Field, namespace: &str, name: &str) -> bool {
478478
/// }
479479
/// ```
480480
///
481-
/// [`serde_as`]: https://docs.rs/serde_with/1.12.1/serde_with/guide/index.html
482-
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/1.12.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
481+
/// [`serde_as`]: https://docs.rs/serde_with/1.13.0/serde_with/guide/index.html
482+
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
483483
#[proc_macro_attribute]
484484
pub fn serde_as(args: TokenStream, input: TokenStream) -> TokenStream {
485485
#[derive(FromMeta, Debug)]
@@ -845,7 +845,7 @@ fn has_type_embedded(type_: &Type, embedded_type: &syn::Ident) -> bool {
845845
/// [`Display`]: std::fmt::Display
846846
/// [`FromStr`]: std::str::FromStr
847847
/// [cargo-toml-rename]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
848-
/// [serde-as-crate]: https://docs.rs/serde_with/1.12.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
848+
/// [serde-as-crate]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
849849
/// [serde-crate]: https://serde.rs/container-attrs.html#crate
850850
#[proc_macro_derive(DeserializeFromStr, attributes(serde_with))]
851851
pub fn derive_deserialize_fromstr(item: TokenStream) -> TokenStream {
@@ -957,7 +957,7 @@ fn deserialize_fromstr(mut input: DeriveInput, serde_with_crate_path: Path) -> T
957957
/// [`Display`]: std::fmt::Display
958958
/// [`FromStr`]: std::str::FromStr
959959
/// [cargo-toml-rename]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
960-
/// [serde-as-crate]: https://docs.rs/serde_with/1.12.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
960+
/// [serde-as-crate]: https://docs.rs/serde_with/1.13.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
961961
/// [serde-crate]: https://serde.rs/container-attrs.html#crate
962962
#[proc_macro_derive(SerializeDisplay, attributes(serde_with))]
963963
pub fn derive_serialize_display(item: TokenStream) -> TokenStream {

0 commit comments

Comments
 (0)