-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
refactor!: make patch_style
& reset_style
chainable
#754
refactor!: make patch_style
& reset_style
chainable
#754
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #754 +/- ##
=======================================
- Coverage 92.3% 92.3% -0.1%
=======================================
Files 55 55
Lines 14831 14828 -3
=======================================
- Hits 13694 13691 -3
Misses 1137 1137 ☔ View full report in Codecov by Sentry. |
I use struct Config {
calendar: Style
}
fn user_config() {
// ...
config.calendar.patch_style(Style::default().fg(color_from_user_input))
// ...
} I wouldn't be able to do this though if |
This doesn't change I think maybe you're talking about not being able to do this on Lines/Spans that are stored? |
e6bb57c
to
278adbe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but I want to make sure that @kdheepak's concern is addressed before merging.
6e56522
to
ab928fb
Compare
Kind of messed up the rebase but its up to date now. |
My bad, didn't review the code changes properly. I don't store |
@Valentin271 the doc tests are failing. |
Previously, `patch_style` and `reset_style` in `Text`, `Line` and `Span` were using a mutable reference to `Self`. To be more consistent with the rest of `ratatui`, which is using fluent setters, these now take ownership of `Self` and return it.
ab928fb
to
da5af28
Compare
I forgot to update the tests after the I'd like another review on this because I modified the examples to be more concise and better demonstrate the effect. Before that the examples were the exact same as the tests. |
Previously,
patch_style
andreset_style
inText
,Line
andSpan
were using a mutable reference toSelf
. To be more consistent with the rest ofratatui
, which is using fluent setters, these now take ownership ofSelf
and return it.Closes #644