Open joshka opened 2 weeks ago
Attention: Patch coverage is 78.94737%
with 8 lines
in your changes missing coverage. Please review.
Project coverage is 94.2%. Comparing base (
4bfdc15
) to head (5c66a94
). Report is 7 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
src/widgets/list.rs | 71.4% | 4 Missing :warning: |
src/widgets/table/table.rs | 75.0% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Similar to the other PR, I think we could do
render_with_state()
instead, but I'm fine withrender_stateful()
. Again, worth checking in with other maintainers for a second opinion.
likewise - I'm 55/45 on stateful vs with_state here too.
Holding for resolution of discussion at https://forum.ratatui.rs/t/naming-render-traits-methods/68
This change renames the
StatefulWidget::render
method torender_stateful
to avoid conflicts with theWidget::render
method.Often both the
Widget
andStatefulWidget
traits are in scope, and when calling therender
method on aStatefulWidget
the compiler cannot determine which trait to use. This change resolves that issue by renaming theStatefulWidget::render
method torender_stateful
.The
StatefulWidget::render
method is still available, but it is deprecated. A default implementation ofrender_stateful
is provided that calls the deprecatedrender
method.Callers should update their code to use
render_stateful
instead ofrender
. implementors of theStatefulWidget
trait should update their implementations to implementrender_stateful
instead ofrender
, and provide an implementation ofrender
that callsrender_stateful
.This change is non-breaking. The deprecated
render
method will be removed in a future release of Ratatui (likely 0.29.0).Addresses part of a problem raised in https://github.com/ratatui-org/ratatui/issues/996