diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2022-11-07 17:32:56 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2022-11-07 17:32:56 +0100 |
commit | 2d3c6dc29aa9075252962af2e99861a0c06e4135 (patch) | |
tree | fa9aacbedd31ed9683a6b19af1e29033de911e10 /src | |
parent | 807e3c1b8080cc697ed46e8e5720e879744858b0 (diff) |
Fix clippy: Do not manually evaluate bool to int
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/value.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/value.rs b/src/value.rs index dced53b..cd7440d 100644 --- a/src/value.rs +++ b/src/value.rs @@ -309,7 +309,7 @@ impl Value { } } - ValueKind::Boolean(value) => Ok(if value { 1 } else { 0 }), + ValueKind::Boolean(value) => Ok(i64::from(value)), ValueKind::Float(value) => Ok(value.round() as i64), // Unexpected type @@ -362,7 +362,7 @@ impl Value { } } - ValueKind::Boolean(value) => Ok(if value { 1 } else { 0 }), + ValueKind::Boolean(value) => Ok(i128::from(value)), ValueKind::Float(value) => Ok(value.round() as i128), // Unexpected type @@ -428,7 +428,7 @@ impl Value { } } - ValueKind::Boolean(value) => Ok(if value { 1 } else { 0 }), + ValueKind::Boolean(value) => Ok(u64::from(value)), ValueKind::Float(value) => Ok(value.round() as u64), // Unexpected type @@ -487,7 +487,7 @@ impl Value { } } - ValueKind::Boolean(value) => Ok(if value { 1 } else { 0 }), + ValueKind::Boolean(value) => Ok(u128::from(value)), ValueKind::Float(value) => Ok(value.round() as u128), // Unexpected type |