diff --git a/src/value/partial_eq.rs b/src/value/partial_eq.rs index 46c1dbc33..8626eed7f 100644 --- a/src/value/partial_eq.rs +++ b/src/value/partial_eq.rs @@ -2,30 +2,30 @@ use super::Value; use alloc::string::String; fn eq_i64(value: &Value, other: i64) -> bool { - value.as_i64().map_or(false, |i| i == other) + value.as_i64() == Some(other) } fn eq_u64(value: &Value, other: u64) -> bool { - value.as_u64().map_or(false, |i| i == other) + value.as_u64() == Some(other) } fn eq_f32(value: &Value, other: f32) -> bool { match value { - Value::Number(n) => n.as_f32().map_or(false, |i| i == other), + Value::Number(n) => n.as_f32() == Some(other), _ => false, } } fn eq_f64(value: &Value, other: f64) -> bool { - value.as_f64().map_or(false, |i| i == other) + value.as_f64() == Some(other) } fn eq_bool(value: &Value, other: bool) -> bool { - value.as_bool().map_or(false, |i| i == other) + value.as_bool() == Some(other) } fn eq_str(value: &Value, other: &str) -> bool { - value.as_str().map_or(false, |i| i == other) + value.as_str() == Some(other) } impl PartialEq for Value {