Make TryFrom and FromStr infallible if there's a default#476
Make TryFrom and FromStr infallible if there's a default#476Peternator7 merged 5 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements infallible parsing for EnumString when a #[strum(default)] variant is present. The key change is that enums with a default variant now derive From<&str> instead of TryFrom<&str>, making parsing infallible (unless a custom error type is specified). This addresses issues #255 and #307, and incorporates ideas from PR #432.
Changes:
- Modified
EnumStringto deriveFrom<&str>instead ofTryFrom<&str>when a default variant exists and no custom error type is set - Updated error type logic to use
Infalliblefor default variants without custom error types - Added comprehensive tests for infallible parsing including PHF support and custom error type interactions
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| strum_macros/src/macros/strings/from_string.rs | Core implementation: refactored to conditionally generate From<&str> vs TryFrom<&str> based on presence of default variant and custom error type |
| strum_macros/src/lib.rs | Updated EnumString documentation to explain infallible parsing behavior and custom error type interactions |
| strum_tests/tests/from_str.rs | Added tests for infallible parsing, custom error types with defaults, and the new From<&str> implementation |
| strum_tests/tests/phf.rs | Added tests for PHF with infallible parsing, including case-insensitive variants |
| strum_tests/src/lib.rs | Added #[strum(default)] to test enum to support infallible parsing tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } else if has_custom_err_ty { | ||
| // The user defined a custom error type, but not a custom error function. This is an error | ||
| // if the method isn't infallible. | ||
| return Err(missing_parse_err_attr_error()); |
There was a problem hiding this comment.
This error message is misleading in this context. Here, the user has provided parse_err_ty but not parse_err_fn, and there's no default variant. The error message "parse_err_ty and parse_err_fn attributes are both required" suggests both are always required together, but after the infallible parsing changes, parse_err_fn is only required when there's no default variant. Consider a more specific error message like "parse_err_fn is required when parse_err_ty is specified without a default variant" or create a new error function for this specific case.
| /// The default error type is `strum::ParseError`. This can be overridden by applying both the | ||
| /// `parse_err_ty` and `parse_err_fn` attributes at the type level. `parse_err_fn` should be a | ||
| /// function that accepts an `&str` and returns the type `parse_err_ty`. See [this test |
There was a problem hiding this comment.
The documentation states that both parse_err_ty and parse_err_fn attributes must be provided to override the error type. However, with the infallible parsing changes, if there's a #[strum(default)] variant, only parse_err_ty is required (see from_string.rs:148-151). Consider updating this to clarify that parse_err_fn is only required when there's no default variant, e.g., "This can be overridden by applying the parse_err_ty attribute (and parse_err_fn when there's no default variant)."
| /// The default error type is `strum::ParseError`. This can be overridden by applying both the | |
| /// `parse_err_ty` and `parse_err_fn` attributes at the type level. `parse_err_fn` should be a | |
| /// function that accepts an `&str` and returns the type `parse_err_ty`. See [this test | |
| /// The default error type is `strum::ParseError`. This can be overridden by applying the | |
| /// `parse_err_ty` attribute (and `parse_err_fn` when there's no `#[strum(default)]` variant) at | |
| /// the type level. `parse_err_fn` should be a function that accepts an `&str` and returns the | |
| /// type `parse_err_ty`. See [this test |
|
Very questionable decision IMHO. It is very confusing to a developer when invalid string results in successful conversion. If anyone wants that, they'd just do Most of the time though developers want to know whether the input was correct or not instead of silently getting the default value. |
|
Maybe the title of the PR isn't entirely clear. This PR clarified existing behavior more than changing anything in a meaningful way. By default, |
|
I think I didn't read it carefully enough and somehow assumed it was |
## Summary This PR fixes the `strum 0.28` dependency bump proposed in [#210](#210) and adds explicit `cargo check --all-targets --all-features --workspace` coverage so example-target compile failures are caught directly in CI instead of being missed by the existing workspace check. ## Root Cause The failure came from the `tui-bar-graph` example, where clap derives a parser for `BarStyle`. `BarStyle` still derives `FromStr`, and this was not caused by the `#[strum(default)]` behavior change from [strum PR #476](Peternator7/strum#476). The actual issue was dependency resolution plus feature unification. Before the bump, `tui-bar-graph` and `ratatui-core` both used `strum 0.27`, so Cargo unified them and `ratatui-core`'s `strum/std` activation effectively carried `std` into the `strum` instance used by `tui-bar-graph`. After [#210](#210), `tui-bar-graph` used `strum 0.28` while `ratatui-core` still used `strum 0.27`, so the graph split into separate `strum` packages. At that point, `tui-bar-graph`'s own `strum 0.28` was built with `default-features = false`, which meant `strum::ParseError` no longer implemented `std::error::Error` in that context. That was enough to break clap's inferred parser for `BarStyle`. ## Code Changes `tui-bar-graph` now declares an explicit `std` feature and uses it to enable `strum/std`. `std` remains enabled by default, so the crate's normal ergonomics do not change. The interactive example is marked with `required-features = ["std"]` so its compile requirements are explicit instead of depending on accidental transitive feature behavior. `colorgrad` now uses `default-features = false`. ## Why Only `strum/std` `strum/std` matters here because it affects trait-based downstream integration on a public enum type. `BarStyle` derives traits whose interaction with clap depends on the trait set of `strum::ParseError`. `colorgrad/std` does not play the same role in this crate today, so the `std` feature does not forward `colorgrad/std`. ## Docs The crate now uses `document-features` so the feature contract is rendered in generated docs and on docs.rs. ## CI The issue exposed by [#210](#210) was a normal compile failure in a non-lib target. The workspace already ran `cargo check --all-features --workspace`, but that does not compile examples and other non-lib targets. `cargo check --all-targets --all-features --workspace` reproduces the failure directly. This PR adds explicit all-targets compile coverage so example-target breakage is caught as a normal build/check failure. ## Verification ```shell cargo check --all-targets --all-features --workspace cargo clippy --all-targets --all-features --workspace -- -D warnings cargo check -p tui-bar-graph --lib --no-default-features cargo doc -p tui-bar-graph --all-features cargo rdme --check --manifest-path tui-bar-graph/Cargo.toml ``` ## Follow-up A broader `no_std` audit of the other widget crates was done during this work and recorded separately on [#102](#102).
## 🤖 New release * `tui-bar-graph`: 0.3.2 -> 0.3.3 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.3.3] - 2026-04-04 ### ⚙️ Miscellaneous Tasks - *(deps)* Lower dependency floors and reduce dependabot noise ([#211](#211)) > ## Summary > > - lower direct dependency requirements to the broadest semver ranges the > workspace actually supports > - keep `Cargo.lock` on current compatible releases, including the direct > `clap`, `tokio`, `futures`, and `rand` updates that fit this PR's scope > - configure Dependabot to group Cargo and GitHub Actions updates and use > `increase-if-necessary` to reduce manifest churn > > ## Details > > This change validates dependency floors with `cargo minimal-versions` in > `--direct` mode so the library manifests reflect honest direct > requirements instead of transitive minimum noise. > > Notable outcomes: > > - broadened requirements such as `clap = "4"` and `tokio = "1"` after > verifying the workspace still compiles and tests against their earliest > compatible direct versions > - kept real floors where required, such as `crossterm = "0.29"`, > `document-features = "0.2.11"`, and `derive_setters = "0.1.9"` > - kept the direct `rand` update to `0.10` and adjusted the > `tui-bar-graph` examples to generate random `Vec<f64>` values in a `rand > 0.10`-compatible way > - kept transitive duplicate major versions where they are still required > by downstream crates like the Ratatui stack or `lipsum` > > Dependabot should now produce less noise because grouped update PRs can > primarily refresh `Cargo.lock` while leaving `Cargo.toml` alone unless a > broader range is truly needed. > > ## Validation > > - `cargo minimal-versions check --workspace --direct` > - `cargo check --all-features --workspace` > - `cargo test --all-features --workspace` > - `cargo minimal-versions test --workspace --all-features --direct` > - `cargo outdated --workspace --root-deps-only` > - `cargo test -p tui-bar-graph --all-features --examples` > > ## Supersedes > > This PR should supersede and allow closing the related Dependabot PRs: - *(deps)* Support strum 0.28 ([#224](#224)) > ## Summary > > This PR fixes the `strum 0.28` dependency bump proposed in > [#210](#210) and adds > explicit `cargo check --all-targets --all-features --workspace` coverage > so example-target compile failures are caught directly in CI instead of > being missed by the existing workspace check. > > ## Root Cause > > The failure came from the `tui-bar-graph` example, where clap derives a > parser for `BarStyle`. > > `BarStyle` still derives `FromStr`, and this was not caused by the > `#[strum(default)]` behavior change from [strum PR > #476](Peternator7/strum#476). The actual issue > was dependency resolution plus feature unification. > > Before the bump, `tui-bar-graph` and `ratatui-core` both used `strum > 0.27`, so Cargo unified them and `ratatui-core`'s `strum/std` activation > effectively carried `std` into the `strum` instance used by > `tui-bar-graph`. After > [#210](#210), `tui-bar-graph` > used `strum 0.28` while `ratatui-core` still used `strum 0.27`, so the > graph split into separate `strum` packages. > > At that point, `tui-bar-graph`'s own `strum 0.28` was built with > `default-features = false`, which meant `strum::ParseError` no longer > implemented `std::error::Error` in that context. That was enough to > break clap's inferred parser for `BarStyle`. > > ## Code Changes > > `tui-bar-graph` now declares an explicit `std` feature and uses it to > enable `strum/std`. `std` remains enabled by default, so the crate's > normal ergonomics do not change. > > The interactive example is marked with `required-features = ["std"]` so > its compile requirements are explicit instead of depending on accidental > transitive feature behavior. > > `colorgrad` now uses `default-features = false`. > > ## Why Only `strum/std` > > `strum/std` matters here because it affects trait-based downstream > integration on a public enum type. `BarStyle` derives traits whose > interaction with clap depends on the trait set of `strum::ParseError`. > > `colorgrad/std` does not play the same role in this crate today, so the > `std` feature does not forward `colorgrad/std`. > > ## Docs > > The crate now uses `document-features` so the feature contract is > rendered in generated docs and on docs.rs. > > ## CI > > The issue exposed by > [#210](#210) was a normal > compile failure in a non-lib target. > > The workspace already ran `cargo check --all-features --workspace`, but > that does not compile examples and other non-lib targets. `cargo check > --all-targets --all-features --workspace` reproduces the failure > directly. > > This PR adds explicit all-targets compile coverage so example-target > breakage is caught as a normal build/check failure. > > ## Verification > > ```shell > cargo check --all-targets --all-features --workspace > cargo clippy --all-targets --all-features --workspace -- -D warnings > cargo check -p tui-bar-graph --lib --no-default-features > cargo doc -p tui-bar-graph --all-features > cargo rdme --check --manifest-path tui-bar-graph/Cargo.toml > ``` > > ## Follow-up > > A broader `no_std` audit of the other widget crates was done during this > work and recorded separately on > [#102](#102). </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## 🤖 New release * `tui-widgets`: 0.7.1 -> 0.7.2 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.7.2] - 2026-04-04 ### ⚙️ Miscellaneous Tasks - *(deps)* Lower dependency floors and reduce dependabot noise ([#211](#211)) > ## Summary > > - lower direct dependency requirements to the broadest semver ranges the > workspace actually supports > - keep `Cargo.lock` on current compatible releases, including the direct > `clap`, `tokio`, `futures`, and `rand` updates that fit this PR's scope > - configure Dependabot to group Cargo and GitHub Actions updates and use > `increase-if-necessary` to reduce manifest churn > > ## Details > > This change validates dependency floors with `cargo minimal-versions` in > `--direct` mode so the library manifests reflect honest direct > requirements instead of transitive minimum noise. > > Notable outcomes: > > - broadened requirements such as `clap = "4"` and `tokio = "1"` after > verifying the workspace still compiles and tests against their earliest > compatible direct versions > - kept real floors where required, such as `crossterm = "0.29"`, > `document-features = "0.2.11"`, and `derive_setters = "0.1.9"` > - kept the direct `rand` update to `0.10` and adjusted the > `tui-bar-graph` examples to generate random `Vec<f64>` values in a `rand > 0.10`-compatible way > - kept transitive duplicate major versions where they are still required > by downstream crates like the Ratatui stack or `lipsum` > > Dependabot should now produce less noise because grouped update PRs can > primarily refresh `Cargo.lock` while leaving `Cargo.toml` alone unless a > broader range is truly needed. > > ## Validation > > - `cargo minimal-versions check --workspace --direct` > - `cargo check --all-features --workspace` > - `cargo test --all-features --workspace` > - `cargo minimal-versions test --workspace --all-features --direct` > - `cargo outdated --workspace --root-deps-only` > - `cargo test -p tui-bar-graph --all-features --examples` > > ## Supersedes > > This PR should supersede and allow closing the related Dependabot PRs: - *(deps)* Support strum 0.28 ([#224](#224)) > ## Summary > > This PR fixes the `strum 0.28` dependency bump proposed in > [#210](#210) and adds > explicit `cargo check --all-targets --all-features --workspace` coverage > so example-target compile failures are caught directly in CI instead of > being missed by the existing workspace check. > > ## Root Cause > > The failure came from the `tui-bar-graph` example, where clap derives a > parser for `BarStyle`. > > `BarStyle` still derives `FromStr`, and this was not caused by the > `#[strum(default)]` behavior change from [strum PR > #476](Peternator7/strum#476). The actual issue > was dependency resolution plus feature unification. > > Before the bump, `tui-bar-graph` and `ratatui-core` both used `strum > 0.27`, so Cargo unified them and `ratatui-core`'s `strum/std` activation > effectively carried `std` into the `strum` instance used by > `tui-bar-graph`. After > [#210](#210), `tui-bar-graph` > used `strum 0.28` while `ratatui-core` still used `strum 0.27`, so the > graph split into separate `strum` packages. > > At that point, `tui-bar-graph`'s own `strum 0.28` was built with > `default-features = false`, which meant `strum::ParseError` no longer > implemented `std::error::Error` in that context. That was enough to > break clap's inferred parser for `BarStyle`. > > ## Code Changes > > `tui-bar-graph` now declares an explicit `std` feature and uses it to > enable `strum/std`. `std` remains enabled by default, so the crate's > normal ergonomics do not change. > > The interactive example is marked with `required-features = ["std"]` so > its compile requirements are explicit instead of depending on accidental > transitive feature behavior. > > `colorgrad` now uses `default-features = false`. > > ## Why Only `strum/std` > > `strum/std` matters here because it affects trait-based downstream > integration on a public enum type. `BarStyle` derives traits whose > interaction with clap depends on the trait set of `strum::ParseError`. > > `colorgrad/std` does not play the same role in this crate today, so the > `std` feature does not forward `colorgrad/std`. > > ## Docs > > The crate now uses `document-features` so the feature contract is > rendered in generated docs and on docs.rs. > > ## CI > > The issue exposed by > [#210](#210) was a normal > compile failure in a non-lib target. > > The workspace already ran `cargo check --all-features --workspace`, but > that does not compile examples and other non-lib targets. `cargo check > --all-targets --all-features --workspace` reproduces the failure > directly. > > This PR adds explicit all-targets compile coverage so example-target > breakage is caught as a normal build/check failure. > > ## Verification > > ```shell > cargo check --all-targets --all-features --workspace > cargo clippy --all-targets --all-features --workspace -- -D warnings > cargo check -p tui-bar-graph --lib --no-default-features > cargo doc -p tui-bar-graph --all-features > cargo rdme --check --manifest-path tui-bar-graph/Cargo.toml > ``` > > ## Follow-up > > A broader `no_std` audit of the other widget crates was done during this > work and recorded separately on > [#102](#102). - *(tui-scrollbar)* Release v0.2.4 ([#213](#213)) > ## 🤖 New release > > * `tui-scrollbar`: 0.2.3 -> 0.2.4 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.2.4] - 2026-04-04 > > ### Other > > - [codex] Vendor CI workflows into this repository > ([#212](#212)) > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). - *(tui-prompts)* Release v0.6.3 ([#214](#214)) > ## 🤖 New release > > * `tui-prompts`: 0.6.2 -> 0.6.3 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.6.3] - 2026-04-04 > > ### ⚙️ Miscellaneous Tasks > > - *(deps)* Lower dependency floors and reduce dependabot noise > ([#211](#211)) > > ## Summary > > > > - lower direct dependency requirements to the broadest semver ranges > the > > workspace actually supports > > - keep `Cargo.lock` on current compatible releases, including the > direct > > `clap`, `tokio`, `futures`, and `rand` updates that fit this PR's > scope > > - configure Dependabot to group Cargo and GitHub Actions updates and > use > > `increase-if-necessary` to reduce manifest churn > > > > ## Details > > > > This change validates dependency floors with `cargo minimal-versions` > in > > `--direct` mode so the library manifests reflect honest direct > > requirements instead of transitive minimum noise. > > > > Notable outcomes: > > > > - broadened requirements such as `clap = "4"` and `tokio = "1"` after > > verifying the workspace still compiles and tests against their > earliest > > compatible direct versions > > - kept real floors where required, such as `crossterm = "0.29"`, > > `document-features = "0.2.11"`, and `derive_setters = "0.1.9"` > > - kept the direct `rand` update to `0.10` and adjusted the > > `tui-bar-graph` examples to generate random `Vec<f64>` values in a > `rand > > 0.10`-compatible way > > - kept transitive duplicate major versions where they are still > required > > by downstream crates like the Ratatui stack or `lipsum` > > > > Dependabot should now produce less noise because grouped update PRs > can > > primarily refresh `Cargo.lock` while leaving `Cargo.toml` alone unless > a > > broader range is truly needed. > > > > ## Validation > > > > - `cargo minimal-versions check --workspace --direct` > > - `cargo check --all-features --workspace` > > - `cargo test --all-features --workspace` > > - `cargo minimal-versions test --workspace --all-features --direct` > > - `cargo outdated --workspace --root-deps-only` > > - `cargo test -p tui-bar-graph --all-features --examples` > > > > ## Supersedes > > > > This PR should supersede and allow closing the related Dependabot PRs: > > ### Other > > - [codex] Vendor CI workflows into this repository > ([#212](#212)) > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). - *(tui-big-text)* Release v0.8.4 ([#215](#215)) > ## 🤖 New release > > * `tui-big-text`: 0.8.3 -> 0.8.4 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.8.4] - 2026-04-04 > > ### ⚙️ Miscellaneous Tasks > > - *(deps)* Lower dependency floors and reduce dependabot noise > ([#211](#211)) > > ## Summary > > > > - lower direct dependency requirements to the broadest semver ranges > the > > workspace actually supports > > - keep `Cargo.lock` on current compatible releases, including the > direct > > `clap`, `tokio`, `futures`, and `rand` updates that fit this PR's > scope > > - configure Dependabot to group Cargo and GitHub Actions updates and > use > > `increase-if-necessary` to reduce manifest churn > > > > ## Details > > > > This change validates dependency floors with `cargo minimal-versions` > in > > `--direct` mode so the library manifests reflect honest direct > > requirements instead of transitive minimum noise. > > > > Notable outcomes: > > > > - broadened requirements such as `clap = "4"` and `tokio = "1"` after > > verifying the workspace still compiles and tests against their > earliest > > compatible direct versions > > - kept real floors where required, such as `crossterm = "0.29"`, > > `document-features = "0.2.11"`, and `derive_setters = "0.1.9"` > > - kept the direct `rand` update to `0.10` and adjusted the > > `tui-bar-graph` examples to generate random `Vec<f64>` values in a > `rand > > 0.10`-compatible way > > - kept transitive duplicate major versions where they are still > required > > by downstream crates like the Ratatui stack or `lipsum` > > > > Dependabot should now produce less noise because grouped update PRs > can > > primarily refresh `Cargo.lock` while leaving `Cargo.toml` alone unless > a > > broader range is truly needed. > > > > ## Validation > > > > - `cargo minimal-versions check --workspace --direct` > > - `cargo check --all-features --workspace` > > - `cargo test --all-features --workspace` > > - `cargo minimal-versions test --workspace --all-features --direct` > > - `cargo outdated --workspace --root-deps-only` > > - `cargo test -p tui-bar-graph --all-features --examples` > > > > ## Supersedes > > > > This PR should supersede and allow closing the related Dependabot PRs: > > ### Other > > - [codex] Vendor CI workflows into this repository > ([#212](#212)) > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). - *(tui-scrollview)* Release v0.6.4 ([#216](#216)) > ## 🤖 New release > > * `tui-scrollview`: 0.6.3 -> 0.6.4 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.6.4] - 2026-04-04 > > ### Other > > - [codex] Vendor CI workflows into this repository > ([#212](#212)) > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). - *(tui-qrcode)* Release v0.2.4 ([#219](#219)) > ## 🤖 New release > > * `tui-qrcode`: 0.2.3 -> 0.2.4 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.2.4] - 2026-04-04 > > ### ⚙️ Miscellaneous Tasks > > - *(deps)* Lower dependency floors and reduce dependabot noise > ([#211](#211)) > > ## Summary > > > > - lower direct dependency requirements to the broadest semver ranges > the > > workspace actually supports > > - keep `Cargo.lock` on current compatible releases, including the > direct > > `clap`, `tokio`, `futures`, and `rand` updates that fit this PR's > scope > > - configure Dependabot to group Cargo and GitHub Actions updates and > use > > `increase-if-necessary` to reduce manifest churn > > > > ## Details > > > > This change validates dependency floors with `cargo minimal-versions` > in > > `--direct` mode so the library manifests reflect honest direct > > requirements instead of transitive minimum noise. > > > > Notable outcomes: > > > > - broadened requirements such as `clap = "4"` and `tokio = "1"` after > > verifying the workspace still compiles and tests against their > earliest > > compatible direct versions > > - kept real floors where required, such as `crossterm = "0.29"`, > > `document-features = "0.2.11"`, and `derive_setters = "0.1.9"` > > - kept the direct `rand` update to `0.10` and adjusted the > > `tui-bar-graph` examples to generate random `Vec<f64>` values in a > `rand > > 0.10`-compatible way > > - kept transitive duplicate major versions where they are still > required > > by downstream crates like the Ratatui stack or `lipsum` > > > > Dependabot should now produce less noise because grouped update PRs > can > > primarily refresh `Cargo.lock` while leaving `Cargo.toml` alone unless > a > > broader range is truly needed. > > > > ## Validation > > > > - `cargo minimal-versions check --workspace --direct` > > - `cargo check --all-features --workspace` > > - `cargo test --all-features --workspace` > > - `cargo minimal-versions test --workspace --all-features --direct` > > - `cargo outdated --workspace --root-deps-only` > > - `cargo test -p tui-bar-graph --all-features --examples` > > > > ## Supersedes > > > > This PR should supersede and allow closing the related Dependabot PRs: > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). - *(tui-popup)* Release v0.7.4 ([#220](#220)) > ## 🤖 New release > > * `tui-popup`: 0.7.3 -> 0.7.4 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.7.4] - 2026-04-04 > > ### ⚙️ Miscellaneous Tasks > > - Update Cargo.toml dependencies > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). - *(tui-box-text)* Release v0.3.3 ([#221](#221)) > ## 🤖 New release > > * `tui-box-text`: 0.3.2 -> 0.3.3 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.3.3] - 2026-04-04 > > ### ⚙️ Miscellaneous Tasks > > - Update Cargo.toml dependencies > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). - *(tui-cards)* Release v0.3.3 ([#222](#222)) > ## 🤖 New release > > * `tui-cards`: 0.3.2 -> 0.3.3 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.3.3] - 2026-04-04 > > ### ⚙️ Miscellaneous Tasks > > - Update Cargo.toml dependencies > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). - *(tui-bar-graph)* Release v0.3.3 ([#223](#223)) > ## 🤖 New release > > * `tui-bar-graph`: 0.3.2 -> 0.3.3 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.3.3] - 2026-04-04 > > ### ⚙️ Miscellaneous Tasks > > - *(deps)* Lower dependency floors and reduce dependabot noise > ([#211](#211)) > > ## Summary > > > > - lower direct dependency requirements to the broadest semver ranges > the > > workspace actually supports > > - keep `Cargo.lock` on current compatible releases, including the > direct > > `clap`, `tokio`, `futures`, and `rand` updates that fit this PR's > scope > > - configure Dependabot to group Cargo and GitHub Actions updates and > use > > `increase-if-necessary` to reduce manifest churn > > > > ## Details > > > > This change validates dependency floors with `cargo minimal-versions` > in > > `--direct` mode so the library manifests reflect honest direct > > requirements instead of transitive minimum noise. > > > > Notable outcomes: > > > > - broadened requirements such as `clap = "4"` and `tokio = "1"` after > > verifying the workspace still compiles and tests against their > earliest > > compatible direct versions > > - kept real floors where required, such as `crossterm = "0.29"`, > > `document-features = "0.2.11"`, and `derive_setters = "0.1.9"` > > - kept the direct `rand` update to `0.10` and adjusted the > > `tui-bar-graph` examples to generate random `Vec<f64>` values in a > `rand > > 0.10`-compatible way > > - kept transitive duplicate major versions where they are still > required > > by downstream crates like the Ratatui stack or `lipsum` > > > > Dependabot should now produce less noise because grouped update PRs > can > > primarily refresh `Cargo.lock` while leaving `Cargo.toml` alone unless > a > > broader range is truly needed. > > > > ## Validation > > > > - `cargo minimal-versions check --workspace --direct` > > - `cargo check --all-features --workspace` > > - `cargo test --all-features --workspace` > > - `cargo minimal-versions test --workspace --all-features --direct` > > - `cargo outdated --workspace --root-deps-only` > > - `cargo test -p tui-bar-graph --all-features --examples` > > > > ## Supersedes > > > > This PR should supersede and allow closing the related Dependabot PRs: > > - *(deps)* Support strum 0.28 > ([#224](#224)) > > ## Summary > > > > This PR fixes the `strum 0.28` dependency bump proposed in > > [#210](#210) and adds > > explicit `cargo check --all-targets --all-features --workspace` > coverage > > so example-target compile failures are caught directly in CI instead > of > > being missed by the existing workspace check. > > > > ## Root Cause > > > > The failure came from the `tui-bar-graph` example, where clap derives > a > > parser for `BarStyle`. > > > > `BarStyle` still derives `FromStr`, and this was not caused by the > > `#[strum(default)]` behavior change from [strum PR > > #476](Peternator7/strum#476). The actual issue > > was dependency resolution plus feature unification. > > > > Before the bump, `tui-bar-graph` and `ratatui-core` both used `strum > > 0.27`, so Cargo unified them and `ratatui-core`'s `strum/std` > activation > > effectively carried `std` into the `strum` instance used by > > `tui-bar-graph`. After > > [#210](#210), > `tui-bar-graph` > > used `strum 0.28` while `ratatui-core` still used `strum 0.27`, so the > > graph split into separate `strum` packages. > > > > At that point, `tui-bar-graph`'s own `strum 0.28` was built with > > `default-features = false`, which meant `strum::ParseError` no longer > > implemented `std::error::Error` in that context. That was enough to > > break clap's inferred parser for `BarStyle`. > > > > ## Code Changes > > > > `tui-bar-graph` now declares an explicit `std` feature and uses it to > > enable `strum/std`. `std` remains enabled by default, so the crate's > > normal ergonomics do not change. > > > > The interactive example is marked with `required-features = ["std"]` > so > > its compile requirements are explicit instead of depending on > accidental > > transitive feature behavior. > > > > `colorgrad` now uses `default-features = false`. > > > > ## Why Only `strum/std` > > > > `strum/std` matters here because it affects trait-based downstream > > integration on a public enum type. `BarStyle` derives traits whose > > interaction with clap depends on the trait set of `strum::ParseError`. > > > > `colorgrad/std` does not play the same role in this crate today, so > the > > `std` feature does not forward `colorgrad/std`. > > > > ## Docs > > > > The crate now uses `document-features` so the feature contract is > > rendered in generated docs and on docs.rs. > > > > ## CI > > > > The issue exposed by > > [#210](#210) was a normal > > compile failure in a non-lib target. > > > > The workspace already ran `cargo check --all-features --workspace`, > but > > that does not compile examples and other non-lib targets. `cargo check > > --all-targets --all-features --workspace` reproduces the failure > > directly. > > > > This PR adds explicit all-targets compile coverage so example-target > > breakage is caught as a normal build/check failure. > > > > ## Verification > > > > ```shell > > cargo check --all-targets --all-features --workspace > > cargo clippy --all-targets --all-features --workspace -- -D warnings > > cargo check -p tui-bar-graph --lib --no-default-features > > cargo doc -p tui-bar-graph --all-features > > cargo rdme --check --manifest-path tui-bar-graph/Cargo.toml > > ``` > > > > ## Follow-up > > > > A broader `no_std` audit of the other widget crates was done during > this > > work and recorded separately on > > [#102](#102). > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). ### Other - [codex] Vendor CI workflows into this repository ([#212](#212)) - [codex] fix(ci): avoid direct secret check in workflow ([#218](#218)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fixes #255 and #307. the PR makes
EnumStringimplementFrom<&str>instead ofTryFromif there is a#[strum(default)]attribute on one of the variants.Incorporates ideas from #432, but decided the breaking change is probably acceptable since it's more accurate to
say the parse is infallible when it is.
*If you come across this and want the old behavior, you can do this: