Skip to content
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

feat(rect): add is_empty() to simplify some common checks #534

Merged
merged 2 commits into from
Sep 26, 2023
Merged

Conversation

joshka
Copy link
Member

@joshka joshka commented Sep 24, 2023

  • refactor(rect): extract Rect to layout/rect.rs
  • feat(rect): add is_empty() to simplify some common checks

@codecov
Copy link

codecov bot commented Sep 24, 2023

Codecov Report

Merging #534 (f236773) into main (32e4619) will increase coverage by 0.00%.
The diff coverage is 98.98%.

@@           Coverage Diff           @@
##             main     #534   +/-   ##
=======================================
  Coverage   89.94%   89.95%           
=======================================
  Files          40       41    +1     
  Lines       11337    11346    +9     
=======================================
+ Hits        10197    10206    +9     
  Misses       1140     1140           
Files Changed Coverage Δ
src/layout.rs 98.25% <ø> (-0.13%) ⬇️
src/layout/rect.rs 98.98% <98.98%> (ø)

Copy link
Sponsor Member

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we should probably note the module changes in the commit description.

@joshka
Copy link
Member Author

joshka commented Sep 26, 2023

LGTM, we should probably note the module changes in the commit description.

There's no public api change (just a developer happiness change). rect is a private module and the Rect type is re-exported under the layout module. I'll note this in the commit.

ratatui/src/layout.rs

Lines 28 to 29 in f236773

mod rect;
pub use rect::*;

@joshka joshka merged commit cbf86da into main Sep 26, 2023
33 checks passed
@joshka joshka deleted the rect-empty branch September 26, 2023 04:45
tonogdlp pushed a commit to tonogdlp/ratatui that referenced this pull request Oct 6, 2023
…g#534)

- add `Rect::is_empty()` that checks whether either height or width == 0
- refactored `Rect` into layout/rect.rs from layout.rs. No public API change as
   the module is private and the type is re-exported under the `layout` module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants