mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
chore(editorconfig): set and apply some defaults (#974)
This commit is contained in:
parent
3834374652
commit
38c17e091c
13 changed files with 40 additions and 35 deletions
|
@ -2,6 +2,12 @@
|
|||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.rs]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
|
1
.github/workflows/check-pr.yml
vendored
1
.github/workflows/check-pr.yml
vendored
|
@ -84,4 +84,3 @@ jobs:
|
|||
echo "Pull request is labeled as 'do not merge'"
|
||||
echo "This workflow fails so that the pull request cannot be merged"
|
||||
exit 1
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ exist to show coverage directly in your editor. E.g.:
|
|||
### Documentation
|
||||
|
||||
Here are some guidelines for writing documentation in Ratatui.
|
||||
|
||||
Every public API **must** be documented.
|
||||
|
||||
Keep in mind that Ratatui tends to attract beginner Rust users that may not be familiar with Rust
|
||||
|
@ -125,10 +126,9 @@ the concepts pointing to the various methods. Focus on interaction with various
|
|||
enough information that helps understand why you might want something.
|
||||
|
||||
Examples should help users understand a particular usage, not test a feature. They should be as
|
||||
simple as possible.
|
||||
Prefer hiding imports and using wildcards to keep things concise. Some imports may still be shown
|
||||
to demonstrate a particular non-obvious import (e.g. `Stylize` trait to use style methods).
|
||||
Speaking of `Stylize`, you should use it over the more verbose style setters:
|
||||
simple as possible. Prefer hiding imports and using wildcards to keep things concise. Some imports
|
||||
may still be shown to demonstrate a particular non-obvious import (e.g. `Stylize` trait to use style
|
||||
methods). Speaking of `Stylize`, you should use it over the more verbose style setters:
|
||||
|
||||
```rust
|
||||
let style = Style::new().red().bold();
|
||||
|
|
|
@ -189,7 +189,7 @@ impl<'a> BarChart<'a> {
|
|||
/// If not set, this defaults to `1`.
|
||||
/// The bar label also uses this value as its width.
|
||||
#[must_use = "method moves the value of self and returns the modified value"]
|
||||
pub fn bar_width(mut self, width: u16) -> BarChart<'a> {
|
||||
pub const fn bar_width(mut self, width: u16) -> BarChart<'a> {
|
||||
self.bar_width = width;
|
||||
self
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue