From b94ed37c1f255f7968bc4dc1dde5296eaeb0d952 Mon Sep 17 00:00:00 2001 From: Marcus Griep Date: Wed, 21 Feb 2018 11:26:59 -0500 Subject: [PATCH] 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. --- juniper/src/integrations/serde.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/juniper/src/integrations/serde.rs b/juniper/src/integrations/serde.rs index 9d973ee1..b1b7bdc0 100644 --- a/juniper/src/integrations/serde.rs +++ b/juniper/src/integrations/serde.rs @@ -79,7 +79,7 @@ impl<'de> de::Deserialize<'de> for InputValue { if value >= i64::from(i32::min_value()) && value <= i64::from(i32::max_value()) { Ok(InputValue::int(value as i32)) } 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 { self.visit_i64(value as i64) } else { - Err(E::custom(format!("integer out of range"))) + Err(E::custom("integer out of range")) } }