Update Rust crate serde_with to 2.2.0 #12

Closed
pierre wants to merge 0 commits from renovate/serde_with-2.x into master
Owner

This PR contains the following updates:

Package Type Update Change
serde_with dependencies minor 2.0.1 -> 2.2.0

Release Notes

jonasbb/serde_with

v2.2.0: serde_with v2.2.0

Compare Source

Added
  • Add new Map and Seq types for converting between maps and tuple lists. (#​527)

    The behavior is not new, but already present using BTreeMap/HashMap or Vec.
    However, the new types Map and Seq are also available on no_std, even without the alloc feature.

Changed
  • Pin the serde_with_macros dependency to the same version as the main crate.
    This simplifies publishing and ensures that always a compatible version is picked.
Fixed
  • serde_with::apply had an issue matching types when invisible token groups where in use (#​538)
    The token groups can stem from macro_rules expansion, but should be treated mostly transparent.
    The old code required a group to match a group, while now groups are silently removed when checking for type patterns.

v2.1.0: serde_with v2.1.0

Compare Source

Added
  • Add new apply attribute to simplify repetitive attributes over many fields.
    Multiple rules and multiple attributes can be provided each.

    #[serde_with::apply(
        Option => #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")],
        Option<bool> => #[serde(rename = "bool")],
    )]
    #[derive(serde::Serialize)]
    struct Data {
        a: Option<String>,
        b: Option<u64>,
        c: Option<String>,
        d: Option<bool>,
    }
    

    The apply attribute will expand into this, applying the attributs to the matching fields:

    #[derive(serde::Serialize)]
    struct Data {
        #[serde(default)]
        #[serde(skip_serializing_if = "Option::is_none")]
        a: Option<String>,
        #[serde(default)]
        #[serde(skip_serializing_if = "Option::is_none")]
        b: Option<u64>,
        #[serde(default)]
        #[serde(skip_serializing_if = "Option::is_none")]
        c: Option<String>,
        #[serde(default)]
        #[serde(skip_serializing_if = "Option::is_none")]
        #[serde(rename = "bool")]
        d: Option<bool>,
    }
    

    The attribute supports field matching using many rules, such as _ to apply to all fields and partial generics like Option to match any Option be it Option<String>, Option<bool>, or Option<T>.

Fixed
  • The derive macros SerializeDisplay and DeserializeFromStr now take better care not to use conflicting names for generic values. (#​526)
    All used generics now start with __ to make conflicts with manually written code unlikely.

    Thanks to @​Elrendio for submitting a PR fixing the issue.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [serde_with](https://github.com/jonasbb/serde_with) | dependencies | minor | `2.0.1` -> `2.2.0` | --- ### Release Notes <details> <summary>jonasbb/serde_with</summary> ### [`v2.2.0`](https://github.com/jonasbb/serde_with/releases/tag/v2.2.0): serde_with v2.2.0 [Compare Source](https://github.com/jonasbb/serde_with/compare/v2.1.0...v2.2.0) ##### Added - Add new `Map` and `Seq` types for converting between maps and tuple lists. ([#&#8203;527](https://github.com/jonasbb/serde_with/issues/527)) The behavior is not new, but already present using `BTreeMap`/`HashMap` or `Vec`. However, the new types `Map` and `Seq` are also available on `no_std`, even without the `alloc` feature. ##### Changed - Pin the `serde_with_macros` dependency to the same version as the main crate. This simplifies publishing and ensures that always a compatible version is picked. ##### Fixed - `serde_with::apply` had an issue matching types when invisible token groups where in use ([#&#8203;538](https://github.com/jonasbb/serde_with/issues/538)) The token groups can stem from macro_rules expansion, but should be treated mostly transparent. The old code required a group to match a group, while now groups are silently removed when checking for type patterns. ### [`v2.1.0`](https://github.com/jonasbb/serde_with/releases/tag/v2.1.0): serde_with v2.1.0 [Compare Source](https://github.com/jonasbb/serde_with/compare/v2.0.1...v2.1.0) ##### Added - Add new `apply` attribute to simplify repetitive attributes over many fields. Multiple rules and multiple attributes can be provided each. ```rust #[serde_with::apply( Option => #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")], Option<bool> => #[serde(rename = "bool")], )] #[derive(serde::Serialize)] struct Data { a: Option<String>, b: Option<u64>, c: Option<String>, d: Option<bool>, } ``` The `apply` attribute will expand into this, applying the attributs to the matching fields: ```rust #[derive(serde::Serialize)] struct Data { #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] a: Option<String>, #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] b: Option<u64>, #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] c: Option<String>, #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "bool")] d: Option<bool>, } ``` The attribute supports field matching using many rules, such as `_` to apply to all fields and partial generics like `Option` to match any `Option` be it `Option<String>`, `Option<bool>`, or `Option<T>`. ##### Fixed - The derive macros `SerializeDisplay` and `DeserializeFromStr` now take better care not to use conflicting names for generic values. ([#&#8203;526](https://github.com/jonasbb/serde_with/issues/526)) All used generics now start with `__` to make conflicts with manually written code unlikely. Thanks to [@&#8203;Elrendio](https://github.com/Elrendio) for submitting a PR fixing the issue. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC40MC4yIiwidXBkYXRlZEluVmVyIjoiMzQuMTA1LjYifQ==-->
pierre changed title from Update Rust crate serde_with to 2.1.0 to Update Rust crate serde_with to 2.2.0 2023-01-19 09:17:41 +00:00
pierre force-pushed renovate/serde_with-2.x from 7b7ca7f2ac to 37c78c5256 2023-01-19 09:17:43 +00:00 Compare
pierre force-pushed renovate/serde_with-2.x from 37c78c5256 to d76b60a858 2023-03-16 00:33:47 +00:00 Compare
pierre closed this pull request 2023-03-19 17:59:43 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pierre/SeaBattle#12
No description provided.