Skip to content

Make TryFrom and FromStr infallible if there's a default#476

Merged
Peternator7 merged 5 commits intomasterfrom
peternator7/infallible-from-str
Feb 22, 2026
Merged

Make TryFrom and FromStr infallible if there's a default#476
Peternator7 merged 5 commits intomasterfrom
peternator7/infallible-from-str

Conversation

@Peternator7
Copy link
Copy Markdown
Owner

@Peternator7 Peternator7 commented Feb 22, 2026

Fixes #255 and #307. the PR makes EnumString implement From<&str> instead of TryFrom if 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:

#[derive(EnumString)]
#[strum(parse_error_ty = strum::ParseError, parse_error_fn = make_error)]
pub enum Color {
    Red,
    Blue
}

fn make_error(x: &str) -> strum::ParseError {
    strum::ParseError
}

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EnumString to derive From<&str> instead of TryFrom<&str> when a default variant exists and no custom error type is set
  • Updated error type logic to use Infallible for 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.

Comment on lines +148 to +151
} 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());
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread strum_macros/src/lib.rs
Comment on lines +68 to 70
/// 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
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)."

Suggested change
/// 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

Copilot uses AI. Check for mistakes.
@Peternator7 Peternator7 merged commit 9334c72 into master Feb 22, 2026
10 checks passed
@nazar-pc
Copy link
Copy Markdown

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 .unwrap_or_default() on the result instead in those rare special cases.

Most of the time though developers want to know whether the input was correct or not instead of silently getting the default value.

@Peternator7
Copy link
Copy Markdown
Owner Author

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, EnumString still generates FromStr<T, ParseError> so you can handle the error however you'd like. However, if you included #[strum(default)] on a variant, that would become the "default" output if none of the other options matched, and it would capture the input string. This was always infallible, but strum continued to generate TryFrom even though the conversion couldn't fail. This PR just changed the behavior in the infallible case to more accurately reflect that the conversion can't fail if you have applied #[strum(default)] to one of the variants. Otherwise, the behavior remains the same.

@nazar-pc
Copy link
Copy Markdown

I think I didn't read it carefully enough and somehow assumed it was #[default] rather than #[strum(default)]. It is not as bad as I thought it was initially. Thanks for explaining.

joshka added a commit to ratatui/tui-widgets that referenced this pull request Apr 4, 2026
## 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).
joshka pushed a commit to ratatui/tui-widgets that referenced this pull request Apr 4, 2026
## 🤖 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>
joshka pushed a commit to ratatui/tui-widgets that referenced this pull request Apr 4, 2026
## 🤖 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

strum::EnumString deriving TryFrom<&str> means From<&str> cannot be implemented

3 participants