-
-
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
refactor: expand glob imports #1152
Conversation
Consensus is that explicit imports make it easier to understand the example code. This commit removes the prelude import from all examples and replaces it with the necessary imports, and expands other glob imports (widget::*, Constraint::*, KeyCode::*, etc.) in all the examples. See #1150 for more details.
Given that there are 4 warnings remaining when enabling (= removing the allow) of wildcard_imports (one in the examples), should it just be enabled in this PR too? Edit: 5 including https://github.com/ratatui-org/ratatui/blob/74a32afbaef8851f9462b27094d88d518e56addf/src/widgets/scrollbar.rs#L7 |
|
…is large, and they are in the same file
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.
This helps a lot with reading code without an IDE ✨
Maybe remove the "all" from the title as prelude::* is still used in the lib itself. Also, this is a "refactor:" as it adapts the source code while maintaining the behavior? 🤔
done and done. Also fixed a doc lint |
Consensus is that explicit imports make it easier to understand the example code. This commit removes the prelude import from all examples and replaces it with the necessary imports, and expands other glob imports (widget::*, Constraint::*, KeyCode::*, etc.) everywhere else. Prelude glob imports not in examples are not covered by this PR. See ratatui#1150 for more details.
Consensus is that explicit imports make it easier to understand the example code. This commit removes the prelude import from all examples and replaces it with the necessary imports, and expands other glob imports (widget::*, Constraint::*, KeyCode::*, etc.) everywhere else. Prelude glob imports not in examples are not covered by this PR. See ratatui#1150 for more details.
Consensus is that explicit imports make it easier to understand the
example code. This commit removes the prelude import from all examples
and replaces it with the necessary imports, and expands other glob
imports (widget::, Constraint::, KeyCode::*, etc.) everywhere else.
Prelude glob imports not in examples are not covered by this PR.
See #1150 for more details.