mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
refactor: clippy::bool_to_int_with_if (#974)
This commit is contained in:
parent
b8ea190bf2
commit
a1f54de7d6
2 changed files with 2 additions and 1 deletions
|
@ -64,6 +64,7 @@ serde_json = "1.0.109"
|
|||
[lints.rust]
|
||||
unsafe_code = "forbid"
|
||||
[lints.clippy]
|
||||
bool_to_int_with_if = "warn"
|
||||
cast_lossless = "warn"
|
||||
cloned_instead_of_copied = "warn"
|
||||
default_trait_access = "warn"
|
||||
|
|
|
@ -406,7 +406,7 @@ impl BarChart<'_> {
|
|||
|
||||
let label_x = area.x;
|
||||
let bars_area = {
|
||||
let margin = if label_size == 0 { 0 } else { 1 };
|
||||
let margin = u16::from(label_size != 0);
|
||||
Rect {
|
||||
x: area.x + label_size + margin,
|
||||
width: area.width - label_size - margin,
|
||||
|
|
Loading…
Reference in a new issue