Skip to content

Commit 03614aa

Browse files
Merge pull request #393 from matthiasbeyer/more-clippy-fixes
More clippy fixes
2 parents 807e3c1 + a73dc37 commit 03614aa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl Environment {
140140
/// Once list_separator is set, the type for string is [`Vec<String>`].
141141
/// To switch the default type back to type Strings you need to provide the keys which should be [`Vec<String>`] using this function.
142142
pub fn with_list_parse_key(mut self, key: &str) -> Self {
143-
if self.list_parse_keys == None {
143+
if self.list_parse_keys.is_none() {
144144
self.list_parse_keys = Some(vec![key.into()])
145145
} else {
146146
self.list_parse_keys = self.list_parse_keys.map(|mut keys| {

src/value.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl Value {
309309
}
310310
}
311311

312-
ValueKind::Boolean(value) => Ok(if value { 1 } else { 0 }),
312+
ValueKind::Boolean(value) => Ok(i64::from(value)),
313313
ValueKind::Float(value) => Ok(value.round() as i64),
314314

315315
// Unexpected type
@@ -362,7 +362,7 @@ impl Value {
362362
}
363363
}
364364

365-
ValueKind::Boolean(value) => Ok(if value { 1 } else { 0 }),
365+
ValueKind::Boolean(value) => Ok(i128::from(value)),
366366
ValueKind::Float(value) => Ok(value.round() as i128),
367367

368368
// Unexpected type
@@ -428,7 +428,7 @@ impl Value {
428428
}
429429
}
430430

431-
ValueKind::Boolean(value) => Ok(if value { 1 } else { 0 }),
431+
ValueKind::Boolean(value) => Ok(u64::from(value)),
432432
ValueKind::Float(value) => Ok(value.round() as u64),
433433

434434
// Unexpected type
@@ -487,7 +487,7 @@ impl Value {
487487
}
488488
}
489489

490-
ValueKind::Boolean(value) => Ok(if value { 1 } else { 0 }),
490+
ValueKind::Boolean(value) => Ok(u128::from(value)),
491491
ValueKind::Float(value) => Ok(value.round() as u128),
492492

493493
// Unexpected type

0 commit comments

Comments
 (0)