Skip to content

Commit c3e489f

Browse files
authored
Bump version to 3.9.0 (#770)
2 parents d038657 + 57ad877 commit c3e489f

File tree

10 files changed

+56
-31
lines changed

10 files changed

+56
-31
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ license = "MIT OR Apache-2.0"
1212
readme = "README.md"
1313
repository = "https://github.com/jonasbb/serde_with/"
1414
rust-version = "1.67"
15-
version = "3.8.3"
15+
version = "3.9.0"
1616

1717
[workspace.metadata.release]
1818
consolidate-commits = true

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,14 @@ Foo::Bytes {
183183
}
184184
```
185185

186-
[`DisplayFromStr`]: https://docs.rs/serde_with/3.8.3/serde_with/struct.DisplayFromStr.html
187-
[`with_prefix!`]: https://docs.rs/serde_with/3.8.3/serde_with/macro.with_prefix.html
188-
[feature flags]: https://docs.rs/serde_with/3.8.3/serde_with/guide/feature_flags/index.html
189-
[skip_serializing_none]: https://docs.rs/serde_with/3.8.3/serde_with/attr.skip_serializing_none.html
190-
[StringWithSeparator]: https://docs.rs/serde_with/3.8.3/serde_with/struct.StringWithSeparator.html
191-
[user guide]: https://docs.rs/serde_with/3.8.3/serde_with/guide/index.html
186+
[`DisplayFromStr`]: https://docs.rs/serde_with/3.9.0/serde_with/struct.DisplayFromStr.html
187+
[`with_prefix!`]: https://docs.rs/serde_with/3.9.0/serde_with/macro.with_prefix.html
188+
[feature flags]: https://docs.rs/serde_with/3.9.0/serde_with/guide/feature_flags/index.html
189+
[skip_serializing_none]: https://docs.rs/serde_with/3.9.0/serde_with/attr.skip_serializing_none.html
190+
[StringWithSeparator]: https://docs.rs/serde_with/3.9.0/serde_with/struct.StringWithSeparator.html
191+
[user guide]: https://docs.rs/serde_with/3.9.0/serde_with/guide/index.html
192192
[with-annotation]: https://serde.rs/field-attrs.html#with
193-
[as-annotation]: https://docs.rs/serde_with/3.8.3/serde_with/guide/serde_as/index.html
193+
[as-annotation]: https://docs.rs/serde_with/3.9.0/serde_with/guide/serde_as/index.html
194194

195195
## License
196196

serde_with/CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [3.9.0] - 2024-07-14
11+
12+
### Added
13+
14+
* Deserialize a map` and skip all elements failing to deserialize by @johnmave126 (#763)
15+
16+
`MapSkipError` acts like a map (`HashMap`/`BTreeMap`), but keys or values that fail to deserialize, like are ignored.
17+
18+
For formats with heterogeneously typed maps, we can collect only the elements where both key and value are deserializable.
19+
This is also useful in conjunction to `#[serde(flatten)]` to ignore some entries when capturing additional fields.
20+
21+
```text
22+
// JSON
23+
"value": {"0": "v0", "5": "v5", "str": "str", "10": 2},
24+
25+
// Rust
26+
#[serde_as(as = "MapSkipError<DisplayFromStr, _>")]
27+
value: BTreeMap<u32, String>,
28+
29+
// Only deserializes entries with a numerical key and a string value, i.e.,
30+
{0 => "v0", 5 => "v5"}
31+
```
32+
1033
## [3.8.3] - 2024-07-03
1134
1235
### Fixed

serde_with/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ schemars_0_8 = {package = "schemars", version = "0.8.16", optional = true, defau
133133
serde = {version = "1.0.152", default-features = false}
134134
serde_derive = "1.0.152"
135135
serde_json = {version = "1.0.45", optional = true, default-features = false}
136-
serde_with_macros = {path = "../serde_with_macros", version = "=3.8.3", optional = true}
136+
serde_with_macros = {path = "../serde_with_macros", version = "=3.9.0", optional = true}
137137
time_0_3 = {package = "time", version = "~0.3.36", optional = true, default-features = false}
138138

139139
[dev-dependencies]

serde_with/src/de/skip_error.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::impls::macros::foreach_map;
22
use crate::prelude::*;
3-
43
#[cfg(feature = "hashbrown_0_14")]
54
use hashbrown_0_14::HashMap as HashbrownMap014;
65
#[cfg(feature = "indexmap_1")]

serde_with/src/lib.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)))]
2222
// Not needed for 2018 edition and conflicts with `rust_2018_idioms`
2323
#![doc(test(no_crate_inject))]
24-
#![doc(html_root_url = "https://docs.rs/serde_with/3.8.3/")]
24+
#![doc(html_root_url = "https://docs.rs/serde_with/3.9.0/")]
2525
#![cfg_attr(docsrs, feature(doc_cfg))]
2626
#![no_std]
2727

@@ -257,14 +257,14 @@
257257
//! # }
258258
//! ```
259259
//!
260-
//! [`DisplayFromStr`]: https://docs.rs/serde_with/3.8.3/serde_with/struct.DisplayFromStr.html
261-
//! [`with_prefix!`]: https://docs.rs/serde_with/3.8.3/serde_with/macro.with_prefix.html
262-
//! [feature flags]: https://docs.rs/serde_with/3.8.3/serde_with/guide/feature_flags/index.html
263-
//! [skip_serializing_none]: https://docs.rs/serde_with/3.8.3/serde_with/attr.skip_serializing_none.html
264-
//! [StringWithSeparator]: https://docs.rs/serde_with/3.8.3/serde_with/struct.StringWithSeparator.html
265-
//! [user guide]: https://docs.rs/serde_with/3.8.3/serde_with/guide/index.html
260+
//! [`DisplayFromStr`]: https://docs.rs/serde_with/3.9.0/serde_with/struct.DisplayFromStr.html
261+
//! [`with_prefix!`]: https://docs.rs/serde_with/3.9.0/serde_with/macro.with_prefix.html
262+
//! [feature flags]: https://docs.rs/serde_with/3.9.0/serde_with/guide/feature_flags/index.html
263+
//! [skip_serializing_none]: https://docs.rs/serde_with/3.9.0/serde_with/attr.skip_serializing_none.html
264+
//! [StringWithSeparator]: https://docs.rs/serde_with/3.9.0/serde_with/struct.StringWithSeparator.html
265+
//! [user guide]: https://docs.rs/serde_with/3.9.0/serde_with/guide/index.html
266266
//! [with-annotation]: https://serde.rs/field-attrs.html#with
267-
//! [as-annotation]: https://docs.rs/serde_with/3.8.3/serde_with/guide/serde_as/index.html
267+
//! [as-annotation]: https://docs.rs/serde_with/3.9.0/serde_with/guide/serde_as/index.html
268268
269269
#[cfg(feature = "alloc")]
270270
extern crate alloc;
@@ -480,7 +480,7 @@ pub use serde_with_macros::*;
480480
/// # }
481481
/// ```
482482
///
483-
/// [serde_as]: https://docs.rs/serde_with/3.8.3/serde_with/attr.serde_as.html
483+
/// [serde_as]: https://docs.rs/serde_with/3.9.0/serde_with/attr.serde_as.html
484484
pub struct As<T: ?Sized>(PhantomData<T>);
485485

486486
/// Adapter to convert from `serde_as` to the serde traits.
@@ -955,7 +955,7 @@ pub struct BytesOrString;
955955
/// ```
956956
///
957957
/// [`chrono::Duration`]: ::chrono_0_4::Duration
958-
/// [feature flag]: https://docs.rs/serde_with/3.8.3/serde_with/guide/feature_flags/index.html
958+
/// [feature flag]: https://docs.rs/serde_with/3.9.0/serde_with/guide/feature_flags/index.html
959959
pub struct DurationSeconds<
960960
FORMAT: formats::Format = u64,
961961
STRICTNESS: formats::Strictness = formats::Strict,
@@ -1087,7 +1087,7 @@ pub struct DurationSeconds<
10871087
/// ```
10881088
///
10891089
/// [`chrono::Duration`]: ::chrono_0_4::Duration
1090-
/// [feature flag]: https://docs.rs/serde_with/3.8.3/serde_with/guide/feature_flags/index.html
1090+
/// [feature flag]: https://docs.rs/serde_with/3.9.0/serde_with/guide/feature_flags/index.html
10911091
pub struct DurationSecondsWithFrac<
10921092
FORMAT: formats::Format = f64,
10931093
STRICTNESS: formats::Strictness = formats::Strict,
@@ -1289,7 +1289,7 @@ pub struct DurationNanoSecondsWithFrac<
12891289
/// [`SystemTime`]: std::time::SystemTime
12901290
/// [`chrono::DateTime<Local>`]: ::chrono_0_4::DateTime
12911291
/// [`chrono::DateTime<Utc>`]: ::chrono_0_4::DateTime
1292-
/// [feature flag]: https://docs.rs/serde_with/3.8.3/serde_with/guide/feature_flags/index.html
1292+
/// [feature flag]: https://docs.rs/serde_with/3.9.0/serde_with/guide/feature_flags/index.html
12931293
pub struct TimestampSeconds<
12941294
FORMAT: formats::Format = i64,
12951295
STRICTNESS: formats::Strictness = formats::Strict,
@@ -1431,7 +1431,7 @@ pub struct TimestampSeconds<
14311431
/// [`chrono::DateTime<Local>`]: ::chrono_0_4::DateTime
14321432
/// [`chrono::DateTime<Utc>`]: ::chrono_0_4::DateTime
14331433
/// [NaiveDateTime]: ::chrono_0_4::NaiveDateTime
1434-
/// [feature flag]: https://docs.rs/serde_with/3.8.3/serde_with/guide/feature_flags/index.html
1434+
/// [feature flag]: https://docs.rs/serde_with/3.9.0/serde_with/guide/feature_flags/index.html
14351435
pub struct TimestampSecondsWithFrac<
14361436
FORMAT: formats::Format = f64,
14371437
STRICTNESS: formats::Strictness = formats::Strict,

serde_with/src/ser/skip_error.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::impls::macros::foreach_map;
22
use crate::prelude::*;
3-
43
#[cfg(feature = "hashbrown_0_14")]
54
use hashbrown_0_14::HashMap as HashbrownMap014;
65
#[cfg(feature = "indexmap_1")]

serde_with_macros/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [3.9.0] - 2024-07-14
11+
12+
No changes.
13+
1014
## [3.8.3] - 2024-07-03
1115

1216
No changes.

serde_with_macros/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
)))]
2121
// Not needed for 2018 edition and conflicts with `rust_2018_idioms`
2222
#![doc(test(no_crate_inject))]
23-
#![doc(html_root_url = "https://docs.rs/serde_with_macros/3.8.3/")]
23+
#![doc(html_root_url = "https://docs.rs/serde_with_macros/3.9.0/")]
2424
// Tarpaulin does not work well with proc macros and marks most of the lines as uncovered.
2525
#![cfg(not(tarpaulin_include))]
2626

@@ -593,8 +593,8 @@ fn field_has_attribute(field: &Field, namespace: &str, name: &str) -> bool {
593593
/// It will also work if the relevant derive is behind a `#[cfg_attr]` attribute
594594
/// and propagate the `#[cfg_attr]` to the various `#[schemars]` field attributes.
595595
///
596-
/// [`serde_as`]: https://docs.rs/serde_with/3.8.3/serde_with/guide/index.html
597-
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/3.8.3/serde_with/guide/serde_as/index.html#re-exporting-serde_as
596+
/// [`serde_as`]: https://docs.rs/serde_with/3.9.0/serde_with/guide/index.html
597+
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/3.9.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
598598
#[proc_macro_attribute]
599599
pub fn serde_as(args: TokenStream, input: TokenStream) -> TokenStream {
600600
#[derive(FromMeta)]
@@ -1039,7 +1039,7 @@ fn has_type_embedded(type_: &Type, embedded_type: &syn::Ident) -> bool {
10391039
/// [`Display`]: std::fmt::Display
10401040
/// [`FromStr`]: std::str::FromStr
10411041
/// [cargo-toml-rename]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
1042-
/// [serde-as-crate]: https://docs.rs/serde_with/3.8.3/serde_with/guide/serde_as/index.html#re-exporting-serde_as
1042+
/// [serde-as-crate]: https://docs.rs/serde_with/3.9.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
10431043
/// [serde-crate]: https://serde.rs/container-attrs.html#crate
10441044
#[proc_macro_derive(DeserializeFromStr, attributes(serde_with))]
10451045
pub fn derive_deserialize_fromstr(item: TokenStream) -> TokenStream {
@@ -1159,7 +1159,7 @@ fn deserialize_fromstr(mut input: DeriveInput, serde_with_crate_path: Path) -> T
11591159
/// [`Display`]: std::fmt::Display
11601160
/// [`FromStr`]: std::str::FromStr
11611161
/// [cargo-toml-rename]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
1162-
/// [serde-as-crate]: https://docs.rs/serde_with/3.8.3/serde_with/guide/serde_as/index.html#re-exporting-serde_as
1162+
/// [serde-as-crate]: https://docs.rs/serde_with/3.9.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
11631163
/// [serde-crate]: https://serde.rs/container-attrs.html#crate
11641164
#[proc_macro_derive(SerializeDisplay, attributes(serde_with))]
11651165
pub fn derive_serialize_display(item: TokenStream) -> TokenStream {

0 commit comments

Comments
 (0)