Skip to content

Commit 892f96b

Browse files
bors[bot]jonasbb
andauthored
Merge #222
222: Bump versions to 1.6.0 for serde_with and 1.3.0 for macros r=jonasbb a=jonasbb Co-authored-by: Jonas Bushart <jonas@bushart.org>
2 parents f11c323 + c48c1b8 commit 892f96b

File tree

9 files changed

+53
-32
lines changed

9 files changed

+53
-32
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ 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-
## [Unreleased]
8+
## [1.6.0]
99

1010
### Added
1111

1212
* Add `DefaultOnNull` as the equivalent for `rust::default_on_null` but for the `serde_as` system.
13+
* Support specifying a path to the `serde_with` crate for the `serde_as` and derive macros.
14+
This is useful when using crate renaming in Cargo.toml or while re-exporting the macros.
15+
16+
Many thanks to @tobz1000 for raising the issue and contributing fixes.
1317

1418
### Changed
1519

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ members = [
77
[package]
88
authors = ["Jonas Bushart"]
99
name = "serde_with"
10-
version = "1.5.1"
10+
version = "1.6.0"
1111

1212
categories = ["encoding"]
1313
description = "Custom de/serialization functions for Rust's serde"
@@ -38,7 +38,7 @@ doc-comment = {version = "0.3.3", optional = true}
3838
hex = {version = "0.4.2", optional = true}
3939
serde = {version = "1.0.75", features = ["derive"]}
4040
serde_json = {version = "1.0.1", optional = true}
41-
serde_with_macros = {path = "./serde_with_macros", version = "1.2.2", optional = true}
41+
serde_with_macros = {path = "./serde_with_macros", version = "1.3.0", optional = true}
4242

4343
[dev-dependencies]
4444
expect-test = "1.0.0"

README.md

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

2626
```toml
2727
[dependencies.serde_with]
28-
version = "1.5.1"
28+
version = "1.6.0"
2929
features = [ "..." ]
3030
```
3131

@@ -119,13 +119,13 @@ Foo {
119119
}
120120
```
121121

122-
[`DisplayFromStr`]: https://docs.rs/serde_with/1.5.1/serde_with/struct.DisplayFromStr.html
123-
[`with_prefix!`]: https://docs.rs/serde_with/1.5.1/serde_with/macro.with_prefix.html
124-
[display_fromstr]: https://docs.rs/serde_with/1.5.1/serde_with/rust/display_fromstr/index.html
125-
[feature flags]: https://docs.rs/serde_with/1.5.1/serde_with/guide/feature_flags/index.html
126-
[skip_serializing_none]: https://docs.rs/serde_with/1.5.1/serde_with/attr.skip_serializing_none.html
127-
[StringWithSeparator]: https://docs.rs/serde_with/1.5.1/serde_with/rust/struct.StringWithSeparator.html
128-
[user guide]: https://docs.rs/serde_with/1.5.1/serde_with/guide/index.html
122+
[`DisplayFromStr`]: https://docs.rs/serde_with/1.6.0/serde_with/struct.DisplayFromStr.html
123+
[`with_prefix!`]: https://docs.rs/serde_with/1.6.0/serde_with/macro.with_prefix.html
124+
[display_fromstr]: https://docs.rs/serde_with/1.6.0/serde_with/rust/display_fromstr/index.html
125+
[feature flags]: https://docs.rs/serde_with/1.6.0/serde_with/guide/feature_flags/index.html
126+
[skip_serializing_none]: https://docs.rs/serde_with/1.6.0/serde_with/attr.skip_serializing_none.html
127+
[StringWithSeparator]: https://docs.rs/serde_with/1.6.0/serde_with/rust/struct.StringWithSeparator.html
128+
[user guide]: https://docs.rs/serde_with/1.6.0/serde_with/guide/index.html
129129
[with-annotation]: https://serde.rs/field-attrs.html#with
130130

131131
## License

serde_with_macros/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ 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-
## [Unreleased]
8+
## [1.3.0]
9+
10+
### Added
11+
12+
* Support specifying a path to the `serde_with` crate for the `serde_as` and derive macros.
13+
This is useful when using crate renaming in Cargo.toml or while re-exporting the macros.
14+
15+
Many thanks to @tobz1000 for raising the issue and contributing fixes.
916

1017
### Changed
1118

serde_with_macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["Jonas Bushart"]
33
name = "serde_with_macros"
4-
version = "1.2.2"
4+
version = "1.3.0"
55

66
categories = ["encoding"]
77
description = "proc-macro library for serde_with"

serde_with_macros/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#![doc(test(attr(warn(rust_2018_idioms))))]
2424
// Not needed for 2018 edition and conflicts with `rust_2018_idioms`
2525
#![doc(test(no_crate_inject))]
26-
#![doc(html_root_url = "https://docs.rs/serde_with_macros/1.2.2")]
26+
#![doc(html_root_url = "https://docs.rs/serde_with_macros/1.3.0")]
2727

2828
//! proc-macro extensions for [`serde_with`]
2929
//!
@@ -422,8 +422,8 @@ fn field_has_attribute(field: &Field, namespace: &str, name: &str) -> bool {
422422
/// }
423423
/// ```
424424
///
425-
/// [`serde_as`]: https://docs.rs/serde_with/1.5.1/serde_with/guide/index.html
426-
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/1.5.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
425+
/// [`serde_as`]: https://docs.rs/serde_with/1.6.0/serde_with/guide/index.html
426+
/// [re-exporting `serde_as`]: https://docs.rs/serde_with/1.6.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
427427
#[proc_macro_attribute]
428428
pub fn serde_as(args: TokenStream, input: TokenStream) -> TokenStream {
429429
#[derive(FromMeta, Debug)]
@@ -739,7 +739,7 @@ fn replace_infer_type_with_type(to_replace: Type, replacement: &Type) -> Type {
739739
/// [`Display`]: std::fmt::Display
740740
/// [`FromStr`]: std::str::FromStr
741741
/// [cargo-toml-rename]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
742-
/// [serde-as-crate]: https://docs.rs/serde_with/1.5.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
742+
/// [serde-as-crate]: https://docs.rs/serde_with/1.6.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
743743
/// [serde-crate]: https://serde.rs/container-attrs.html#crate
744744
#[proc_macro_derive(DeserializeFromStr, attributes(serde_with))]
745745
pub fn derive_deserialize_fromstr(item: TokenStream) -> TokenStream {
@@ -852,7 +852,7 @@ fn deserialize_fromstr(
852852
/// [`Display`]: std::fmt::Display
853853
/// [`FromStr`]: std::str::FromStr
854854
/// [cargo-toml-rename]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
855-
/// [serde-as-crate]: https://docs.rs/serde_with/1.5.1/serde_with/guide/serde_as/index.html#re-exporting-serde_as
855+
/// [serde-as-crate]: https://docs.rs/serde_with/1.6.0/serde_with/guide/serde_as/index.html#re-exporting-serde_as
856856
/// [serde-crate]: https://serde.rs/container-attrs.html#crate
857857
#[proc_macro_derive(SerializeDisplay, attributes(serde_with))]
858858
pub fn derive_serialize_display(item: TokenStream) -> TokenStream {

serde_with_macros/tests/version_numbers.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
fn test_html_root_url() {
33
version_sync::assert_html_root_url_updated!("src/lib.rs");
44
}
5+
6+
#[test]
7+
fn test_changelog() {
8+
version_sync::assert_contains_regex!("CHANGELOG.md", r#"## \[{version}\]"#);
9+
}

src/lib.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#![doc(test(attr(warn(rust_2018_idioms))))]
2424
// Not needed for 2018 edition and conflicts with `rust_2018_idioms`
2525
#![doc(test(no_crate_inject))]
26-
#![doc(html_root_url = "https://docs.rs/serde_with/1.5.1")]
26+
#![doc(html_root_url = "https://docs.rs/serde_with/1.6.0")]
2727
// Rust 1.45: introduction of `strip_prefix` used by clippy::manual_strip
2828
#![allow(clippy::unknown_clippy_lints)]
2929

@@ -52,7 +52,7 @@
5252
//!
5353
//! ```toml
5454
//! [dependencies.serde_with]
55-
//! version = "1.5.1"
55+
//! version = "1.6.0"
5656
//! features = [ "..." ]
5757
//! ```
5858
//!
@@ -191,13 +191,13 @@
191191
//! # }
192192
//! ```
193193
//!
194-
//! [`DisplayFromStr`]: https://docs.rs/serde_with/1.5.1/serde_with/struct.DisplayFromStr.html
195-
//! [`with_prefix!`]: https://docs.rs/serde_with/1.5.1/serde_with/macro.with_prefix.html
196-
//! [display_fromstr]: https://docs.rs/serde_with/1.5.1/serde_with/rust/display_fromstr/index.html
197-
//! [feature flags]: https://docs.rs/serde_with/1.5.1/serde_with/guide/feature_flags/index.html
198-
//! [skip_serializing_none]: https://docs.rs/serde_with/1.5.1/serde_with/attr.skip_serializing_none.html
199-
//! [StringWithSeparator]: https://docs.rs/serde_with/1.5.1/serde_with/rust/struct.StringWithSeparator.html
200-
//! [user guide]: https://docs.rs/serde_with/1.5.1/serde_with/guide/index.html
194+
//! [`DisplayFromStr`]: https://docs.rs/serde_with/1.6.0/serde_with/struct.DisplayFromStr.html
195+
//! [`with_prefix!`]: https://docs.rs/serde_with/1.6.0/serde_with/macro.with_prefix.html
196+
//! [display_fromstr]: https://docs.rs/serde_with/1.6.0/serde_with/rust/display_fromstr/index.html
197+
//! [feature flags]: https://docs.rs/serde_with/1.6.0/serde_with/guide/feature_flags/index.html
198+
//! [skip_serializing_none]: https://docs.rs/serde_with/1.6.0/serde_with/attr.skip_serializing_none.html
199+
//! [StringWithSeparator]: https://docs.rs/serde_with/1.6.0/serde_with/rust/struct.StringWithSeparator.html
200+
//! [user guide]: https://docs.rs/serde_with/1.6.0/serde_with/guide/index.html
201201
//! [with-annotation]: https://serde.rs/field-attrs.html#with
202202
203203
#[doc(hidden)]
@@ -333,7 +333,7 @@ impl Separator for CommaSeparator {
333333
/// # }
334334
/// ```
335335
///
336-
/// [serde_as]: https://docs.rs/serde_with/1.5.1/serde_with/attr.serde_as.html
336+
/// [serde_as]: https://docs.rs/serde_with/1.6.0/serde_with/attr.serde_as.html
337337
#[derive(Copy, Clone, Debug, Default)]
338338
pub struct As<T>(PhantomData<T>);
339339

@@ -799,7 +799,7 @@ pub struct BytesOrString;
799799
/// ```
800800
///
801801
/// [`chrono::Duration`]: chrono_crate::Duration
802-
/// [feature flag]: https://docs.rs/serde_with/1.5.1/serde_with/guide/feature_flags/index.html
802+
/// [feature flag]: https://docs.rs/serde_with/1.6.0/serde_with/guide/feature_flags/index.html
803803
#[derive(Copy, Clone, Debug, Default)]
804804
pub struct DurationSeconds<
805805
FORMAT: formats::Format = u64,
@@ -925,7 +925,7 @@ pub struct DurationSeconds<
925925
/// ```
926926
///
927927
/// [`chrono::Duration`]: chrono_crate::Duration
928-
/// [feature flag]: https://docs.rs/serde_with/1.5.1/serde_with/guide/feature_flags/index.html
928+
/// [feature flag]: https://docs.rs/serde_with/1.6.0/serde_with/guide/feature_flags/index.html
929929
#[derive(Copy, Clone, Debug, Default)]
930930
pub struct DurationSecondsWithFrac<
931931
FORMAT: formats::Format = f64,
@@ -1068,7 +1068,7 @@ pub struct DurationSecondsWithFrac<
10681068
///
10691069
/// [`SystemTime`]: std::time::SystemTime
10701070
/// [DateTime]: chrono_crate::DateTime
1071-
/// [feature flag]: https://docs.rs/serde_with/1.5.1/serde_with/guide/feature_flags/index.html
1071+
/// [feature flag]: https://docs.rs/serde_with/1.6.0/serde_with/guide/feature_flags/index.html
10721072
#[derive(Copy, Clone, Debug, Default)]
10731073
pub struct TimestampSeconds<
10741074
FORMAT: formats::Format = i64,
@@ -1197,7 +1197,7 @@ pub struct TimestampSeconds<
11971197
///
11981198
/// [`SystemTime`]: std::time::SystemTime
11991199
/// [DateTime]: chrono_crate::DateTime
1200-
/// [feature flag]: https://docs.rs/serde_with/1.5.1/serde_with/guide/feature_flags/index.html
1200+
/// [feature flag]: https://docs.rs/serde_with/1.6.0/serde_with/guide/feature_flags/index.html
12011201
#[derive(Copy, Clone, Debug, Default)]
12021202
pub struct TimestampSecondsWithFrac<
12031203
FORMAT: formats::Format = f64,

tests/version_numbers.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ fn test_readme_deps_in_lib() {
1212
assert_contains_regex!("src/lib.rs", r#"^//! version = "{version}""#);
1313
}
1414

15+
#[test]
16+
fn test_changelog() {
17+
assert_contains_regex!("CHANGELOG.md", r#"## \[{version}\]"#);
18+
}
19+
1520
#[test]
1621
fn test_html_root_url() {
1722
assert_html_root_url_updated!("src/lib.rs");

0 commit comments

Comments
 (0)