Skip to content

Commit

Permalink
refactor: clippy::bool_to_int_with_if (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo authored and joshka committed Mar 4, 2024
1 parent b8ea190 commit a1f54de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/barchart.rs
Expand Up @@ -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,
Expand Down

0 comments on commit a1f54de

Please sign in to comment.