Remove unnecessary format!()
The `E::custom()` function requires a value of any type that implements `fmt::Display`, so a plain `&str` works just fine here.
This commit is contained in:
parent
d1cddfb55f
commit
b94ed37c1f
1 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ impl<'de> de::Deserialize<'de> for InputValue {
|
||||||
if value >= i64::from(i32::min_value()) && value <= i64::from(i32::max_value()) {
|
if value >= i64::from(i32::min_value()) && value <= i64::from(i32::max_value()) {
|
||||||
Ok(InputValue::int(value as i32))
|
Ok(InputValue::int(value as i32))
|
||||||
} else {
|
} else {
|
||||||
Err(E::custom(format!("integer out of range")))
|
Err(E::custom("integer out of range"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ impl<'de> de::Deserialize<'de> for InputValue {
|
||||||
if value <= i32::max_value() as u64 {
|
if value <= i32::max_value() as u64 {
|
||||||
self.visit_i64(value as i64)
|
self.visit_i64(value as i64)
|
||||||
} else {
|
} else {
|
||||||
Err(E::custom(format!("integer out of range")))
|
Err(E::custom("integer out of range"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue