-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
perf(rect)!: Rect::inner
takes Margin
directly instead of reference
#1008
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1008 +/- ##
=====================================
Coverage 94.2% 94.2%
=====================================
Files 60 60
Lines 14630 14630
=====================================
Hits 13790 13790
Misses 840 840 ☔ View full report in Codecov by Sentry. |
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 as a breaking change
- Update the PR message to be changelog focused (e.g. tell the user how they need to change their apps.) Something like "Rect::inner() now takes Margin instead of &Margin"
- Add the info to the breaking change doc
- Add the breaking change section of the commit (https://www.conventionalcommits.org/)
- Make sure there's a small example of how to fix the change in both places (this is overkill for such a small change, but doing it consistently makes it easy for users upgrading to search for this sort of thing easily)
Hold off merging until 0.27.0 release is ready to go after 0.26.2
Rect::inner
takes Margin
directly instead of reference
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.
Changes look good. We can merge this when we go to 0.27.0
I think the next version will probably be 0.26.2 and then have all breaking changes batched up in 0.27.0
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
BTW, I expect this will probably break a lot of projects (520 results): |
I'd like for this change to be made because it'll make it consistent with a future feature like: #931 |
Sounds like we should break both things at the same time to avoid double breaks. |
Also, adds `Rect::ZERO` and `Rect::inner` is now `const`. BREAKING CHANGE: `Margin` needs to be passed without reference now.
Conflicts: src/widgets/canvas/rectangle.rs
This comment was marked as outdated.
This comment was marked as outdated.
Conflicts: BREAKING-CHANGES.md
…ce (ratatui#1008) BREAKING CHANGE: Margin needs to be passed without reference now. ```diff -let area = area.inner(&Margin { +let area = area.inner(Margin { vertical: 0, horizontal: 2, }); ```
BREAKING CHANGE: Margin needs to be passed without reference now.