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

docs(layout::Constraint): add doc-comments for all variants #371

Merged
merged 1 commit into from
Aug 5, 2023

Conversation

hasezoey
Copy link
Contributor

@hasezoey hasezoey commented Aug 5, 2023

This PR adds at least some documentation on what each variant does, with examples (and so doc-tests)

fixes #354

@codecov
Copy link

codecov bot commented Aug 5, 2023

Codecov Report

Merging #371 (2f9845e) into main (3a37d2f) will not change coverage.
The diff coverage is n/a.

❗ Current head 2f9845e differs from pull request most recent head c7e8cb5. Consider uploading reports for the commit c7e8cb5 to get more accurate results

@@           Coverage Diff           @@
##             main     #371   +/-   ##
=======================================
  Coverage   84.99%   84.99%           
=======================================
  Files          40       40           
  Lines        8686     8686           
=======================================
  Hits         7383     7383           
  Misses       1303     1303           
Files Changed Coverage Δ
src/layout.rs 89.18% <ø> (ø)

@joshka
Copy link
Member

joshka commented Aug 5, 2023

See #354 (comment) for some detail on the panic. I was mistaken.

src/layout.rs Outdated Show resolved Hide resolved
Copy link
Member

@joshka joshka left a comment

Choose a reason for hiding this comment

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

This looks great. There was some discussion about when to use doctests vs unit tests in #324. I think this is a perfect example of when asserts in doc tests are useful as it helps show much more detail about the edge cases. If these were instead unit tests, they would not be as discoverable.

Change requested is just the comments about the panicing / github comment.

@joshka joshka added this pull request to the merge queue Aug 5, 2023
Merged via the queue into ratatui-org:main with commit c8ddc16 Aug 5, 2023
30 checks passed
@hasezoey hasezoey deleted the docConstraintVariants branch August 6, 2023 09:27
@joshka joshka added this to the v0.23.0 milestone Aug 21, 2023
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.

Layout: Documentation for all Constraint variants
2 participants