Commit fe40249
authored
chore(deps): support strum 0.28 (#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).1 parent 7596dd3 commit fe40249
5 files changed
Lines changed: 69 additions & 80 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
15 | | - | |
| 24 | + | |
| 25 | + | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
| |||
22 | 32 | | |
23 | 33 | | |
24 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
0 commit comments