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:
Marcus Griep 2018-02-21 11:26:59 -05:00 committed by theduke
parent d1cddfb55f
commit b94ed37c1f

View file

@ -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"))
} }
} }