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: import prelude::* in doc examples #490

Merged
merged 1 commit into from
Sep 12, 2023
Merged

docs: import prelude::* in doc examples #490

merged 1 commit into from
Sep 12, 2023

Conversation

joshka
Copy link
Member

@joshka joshka commented Sep 11, 2023

This commit adds prelude::* all doc examples and widget::* to those
that need it. This is done to highlight the use of the prelude and
simplify the examples.

  • Examples in Type and module level comments show all imports and use
    prelude::* and widget::* where possible.
  • Function level comments hide imports unless there are imports other
    than prelude::* and widget::*.

Fixes #448 by ensuring that module and type level code always contains all the imports required to compile the example.

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #490 (206300d) into main (1947c58) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main     #490   +/-   ##
=======================================
  Coverage   90.16%   90.16%           
=======================================
  Files          41       41           
  Lines       11277    11277           
=======================================
  Hits        10168    10168           
  Misses       1109     1109           
Files Changed Coverage Δ
src/backend/test.rs 94.84% <ø> (ø)
src/buffer.rs 94.06% <ø> (ø)
src/layout.rs 98.29% <ø> (ø)
src/style.rs 92.33% <0.00%> (ø)
src/style/color.rs 95.62% <ø> (ø)
src/terminal.rs 58.30% <ø> (ø)
src/text/line.rs 96.55% <ø> (ø)
src/text/masked.rs 98.64% <ø> (ø)
src/text/span.rs 100.00% <ø> (ø)
src/text/spans.rs 96.29% <ø> (ø)
... and 17 more

This commit adds `prelude::*` all doc examples and widget::* to those
that need it. This is done to highlight the use of the prelude and
simplify the examples.

- Examples in Type and module level comments show all imports and use
  `prelude::*` and `widget::*` where possible.
- Function level comments hide imports unless there are imports other
  than `prelude::*` and `widget::*`.
@joshka
Copy link
Member Author

joshka commented Sep 12, 2023

Rebased on the other doc changes to fix conflicts

@joshka joshka merged commit 1414fbc into main Sep 12, 2023
@joshka joshka deleted the docs-prelude branch September 12, 2023 01:02
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.

BarChart example in docs.rs cannot be compiled
2 participants