-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
chore: Correct "builder methods" in docs and add must_use
on widgets setters
#655
Conversation
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.
Definitely not a word that I'm used to but +1 for doing things by the book.
@joshka I made a WIP commit, do you think this is correct? I'll follow this pattern if this sample is fine. |
LGTM - go for it |
Oh BTW if you want to find all the places that could be must_use like this automatically - there's a clippy lint that you can use. It probably shouldn't be enabled by default as I suspect it would probably have some noise (things we don't want to make must_use), but it might help. cargo clippy -- -W clippy::must-use-candidate (And I'm happy to split that task off to another PR as it's quite large) Edit the following will get you to a place where you can examine the potential diff more easily: cargo clippy --fix -- -W clippy::must-use-candidate
cargo make format Edit 4: I suspect that just omitting the message might be sufficient if we do decide to do this in bulk |
312957d
to
0d16b19
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #655 +/- ##
=====================================
Coverage 90.9% 90.9%
=====================================
Files 42 42
Lines 12533 12533
=====================================
Hits 11394 11394
Misses 1139 1139 ☔ View full report in Codecov by Sentry. |
must_use
on widgets setters
Sounds good |
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.
LGTM generally - a couple of small things
b6ea61c
to
847118a
Compare
@joshka Ok, I've fixed them now. |
Thanks for the small fixes. Would you mind please squashing your commits locally (so that that last commit is signed and I can merge it)? |
…s setters Fixes ratatui#650 This PR corrects the "builder methods" expressing to simple `setters` (see ratatui#650 ratatui#655), and gives a clearer diagnostic notice on setters `must_use`. `#[must_use = "method moves the value of self and returns the modified value"]` Details: docs: Correct wording in docs from builder methods Add `must_use` on layout setters chore: add `must_use` on widgets fluent methods This commit ignored `table.rs` because it is included in other PRs. test(gauge): fix test
847118a
to
5d25008
Compare
@joshka Sure, I've squashed it. |
Hrm - the commit is still not gpg signed (so I get a merging is blocked error) |
…s setters Fixes ratatui#650 This PR corrects the "builder methods" expressing to simple `setters` (see ratatui#650 ratatui#655), and gives a clearer diagnostic notice on setters `must_use`. `#[must_use = "method moves the value of self and returns the modified value"]` Details: docs: Correct wording in docs from builder methods Add `must_use` on layout setters chore: add `must_use` on widgets fluent methods This commit ignored `table.rs` because it is included in other PRs. test(gauge): fix test
5d25008
to
abc0b1d
Compare
…s setters Fixes ratatui#650 This PR corrects the "builder methods" expressing to simple `setters` (see ratatui#650 ratatui#655), and gives a clearer diagnostic notice on setters `must_use`. `#[must_use = "method moves the value of self and returns the modified value"]` Details: docs: Correct wording in docs from builder methods Add `must_use` on layout setters chore: add `must_use` on widgets fluent methods This commit ignored `table.rs` because it is included in other PRs. test(gauge): fix test
abc0b1d
to
a455798
Compare
@joshka Sorry, I was at my workplace without my PC. It took me some time to go back and reach my own PC. |
This PR corrects the "builder methods" expressing to simple
setters
(see #650 #655), and gives a clearer diagnostic notice on settersmust_use
.#[must_use = "method moves the value of self and returns the modified value"]
Fixes #650