refactor: clippy::bool_to_int_with_if (#974)

This commit is contained in:
EdJoPaTo 2024-03-02 12:01:21 +01:00 committed by Josh McKinney
parent b8ea190bf2
commit a1f54de7d6
No known key found for this signature in database
GPG key ID: 722287396A903BC5
2 changed files with 2 additions and 1 deletions

View file

@ -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"

View file

@ -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,