Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update strum monorepo to 0.26.0 #995

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 3, 2024

This PR contains the following updates:

Package Type Update Change
strum dependencies minor 0.25.0 -> 0.26.0
strum_macros dependencies minor 0.25.1 -> 0.26.0

Release Notes

Peternator7/strum (strum)

v0.26.3

Compare Source

  • #​344: Hide EnumTable because it's going to be deprecated in the next
    version.
  • #​357: Fixes an incompatiblity with itertools by using the fully
    qualified name rather than the inherent method.
  • #​345: Allows unnamed tuple like variants to use their variants in
    string interpolation. #[strum(to_string = "Field 0: {0}, Field 1: {1})")] will now work for tuple variants

v0.26.2

Compare Source

  • #​337: Fix missing generic impls for EnumTryAs
  • #​334: Support prefix in AsRefStr. Technically a breaking change,
    but prefix was just added in 0.26.0 so it's a newer feature and it makes the feature more consisent in general.

v0.26.1

  • #​325: use core instead of std in VariantArray.

v0.26.0

Breaking Changes
  • The EnumVariantNames macro has been renamed VariantNames. The deprecation warning should steer you in
    the right direction for fixing the warning.
  • The Iterator struct generated by EnumIter now has new bounds on it. This shouldn't break code unless you manually
    added the implementation in your code.
  • Display now supports format strings using named fields in the enum variant. This should be a no-op for most code.
    However, if you were outputting a string like "Hello {field}", this will now be interpretted as a format string.
  • EnumDiscriminant now inherits the repr and discriminant values from your main enum. This makes the discriminant type
    closer to a mirror of the original and that's always the goal.
New features
  • The VariantArray macro has been added. This macro adds an associated constant VARIANTS to your enum. The constant
    is a &'static [Self] slice so that you can access all the variants of your enum. This only works on enums that only
    have unit variants.

    use strum::VariantArray;
    
    #[derive(Debug, VariantArray)]
    enum Color {
      Red,
      Blue,
      Green,
    }
    
    fn main() {
      println!("{:?}", Color::VARIANTS); // prints: ["Red", "Blue", "Green"]
    }
  • The EnumTable macro has been experimentally added. This macro adds a new type that stores an item for each variant
    of the enum. This is useful for storing a value for each variant of an enum. This is an experimental feature because
    I'm not convinced the current api surface area is correct.

    use strum::EnumTable;
    
    #[derive(Copy, Clone, Debug, EnumTable)]
    enum Color {
      Red,
      Blue,
      Green,
    }
    
    fn main() {
      let mut counts = ColorTable::filled(0);
      for color in &[Color::Red, Color::Red, Color::Green]] {
        counts[color] += 1;
      }
    
      assert_eq!(counts[Color::Red], 2);
      assert_eq!(counts[Color::Blue], 0);
      assert_eq!(counts[Color::Green], 1);
    }
  • Display has 2 new features:

    • the strum(prefix = "some_value") attribute on an enum now allows you to prepend a string onto every
      variant when you serialize it.

    • Custom to_string and serialize attributes now support string interopolation on serialization.

PR's Merged
  • #​322: avoid collisions on std::fmt::Debug
  • #​321: avoid conflicts with consecutive underscores.
  • #​314: add additional bounds to EnumIterator
  • #​311: add FusedIterator bounds to EnumIterator
  • #​297: New macro, add VariantArray
  • #​296: adds prefix attribute to To/From String macros.
  • #​294: use named enum fields in to_string macro.
  • #​288: discriminant enums now inherit the repr from the original enum.
  • #​279: Add EnumTable macro to generate a mapping between fieldless variants and data.

Configuration

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

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

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


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

This PR was generated by Mend Renovate. View the repository job log.

Sorry, something went wrong.

@renovate renovate bot added the dependencies label Jun 3, 2024
@renovate renovate bot enabled auto-merge (squash) June 3, 2024 18:03
@renovate renovate bot requested a review from a team June 3, 2024 18:03
Copy link
Contributor Author

renovate bot commented Jun 3, 2024

⚠️ Artifact update problem

Renovate failed to update artifacts related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: Cargo.lock
Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path full-service/Cargo.toml --workspace
    Updating crates.io index
error: failed to get `ledger-mob-apdu` as a dependency of package `ledger-mob v0.16.0 (/tmp/renovate/repos/github/mobilecoinofficial/full-service/ledger-mob/lib)`
    ... which satisfies path dependency `ledger-mob` (locked to 0.16.0) of package `mc-full-service v2.10.5 (/tmp/renovate/repos/github/mobilecoinofficial/full-service/full-service)`

Caused by:
  failed to load source for dependency `ledger-mob-apdu`

Caused by:
  Unable to update /tmp/renovate/repos/github/mobilecoinofficial/full-service/ledger-mob/apdu

Caused by:
  failed to parse manifest at `/tmp/renovate/repos/github/mobilecoinofficial/full-service/ledger-mob/apdu/Cargo.toml`

Caused by:
  the cargo feature `per-package-target` requires a nightly version of Cargo, but this is the `stable` channel
  See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
  See https://doc.rust-lang.org/cargo/reference/unstable.html#per-package-target for more information about using this feature.

File name: Cargo.lock
Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path signer/Cargo.toml --workspace
    Updating crates.io index
error: failed to get `ledger-mob-apdu` as a dependency of package `ledger-mob v0.16.0 (/tmp/renovate/repos/github/mobilecoinofficial/full-service/ledger-mob/lib)`
    ... which satisfies path dependency `ledger-mob` (locked to 0.16.0) of package `mc-full-service v2.10.5 (/tmp/renovate/repos/github/mobilecoinofficial/full-service/full-service)`

Caused by:
  failed to load source for dependency `ledger-mob-apdu`

Caused by:
  Unable to update /tmp/renovate/repos/github/mobilecoinofficial/full-service/ledger-mob/apdu

Caused by:
  failed to parse manifest at `/tmp/renovate/repos/github/mobilecoinofficial/full-service/ledger-mob/apdu/Cargo.toml`

Caused by:
  the cargo feature `per-package-target` requires a nightly version of Cargo, but this is the `stable` channel
  See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
  See https://doc.rust-lang.org/cargo/reference/unstable.html#per-package-target for more information about using this feature.

@renovate renovate bot force-pushed the renovate/strum-monorepo branch 2 times, most recently from c2d89d0 to 9092ff5 Compare June 4, 2024 04:22
@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.13%. Comparing base (ab2af32) to head (175abbd).
Report is 212 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #995      +/-   ##
==========================================
+ Coverage   60.12%   69.13%   +9.01%     
==========================================
  Files          88      125      +37     
  Lines       12356    16687    +4331     
  Branches     2010     2798     +788     
==========================================
+ Hits         7429    11537    +4108     
- Misses       3238     5150    +1912     
+ Partials     1689        0    -1689     
Flag Coverage Δ
69.13% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renovate renovate bot force-pushed the renovate/strum-monorepo branch 3 times, most recently from 723155d to e6323c4 Compare June 7, 2024 21:47
@renovate renovate bot force-pushed the renovate/strum-monorepo branch from e6323c4 to 4fdcd90 Compare July 19, 2024 00:37
@renovate renovate bot requested a review from lnsiegel as a code owner July 19, 2024 00:37
@renovate renovate bot force-pushed the renovate/strum-monorepo branch from 4fdcd90 to a1e27da Compare July 25, 2024 21:11
@renovate renovate bot force-pushed the renovate/strum-monorepo branch 2 times, most recently from a2e14c7 to 12abecc Compare September 10, 2024 19:58
@renovate renovate bot force-pushed the renovate/strum-monorepo branch 5 times, most recently from b9c8ef1 to 175abbd Compare September 24, 2024 14:03
@renovate renovate bot force-pushed the renovate/strum-monorepo branch 4 times, most recently from 4846771 to be273fb Compare November 6, 2024 06:49
@renovate renovate bot force-pushed the renovate/strum-monorepo branch 2 times, most recently from 5428ec2 to 598e0cf Compare November 8, 2024 21:10
@renovate renovate bot force-pushed the renovate/strum-monorepo branch 4 times, most recently from b215857 to b445b4e Compare November 21, 2024 20:35
@renovate renovate bot force-pushed the renovate/strum-monorepo branch 7 times, most recently from 3049349 to bef748e Compare December 5, 2024 17:14

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@renovate renovate bot force-pushed the renovate/strum-monorepo branch from bef748e to 96ce567 Compare December 5, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant