Skip to content

Commit

Permalink
Remove unnecessary format!()
Browse files Browse the repository at this point in the history
The `E::custom()` function requires a value of any type that implements
`fmt::Display`, so a plain `&str` works just fine here.
  • Loading branch information
neoeinstein committed Feb 21, 2018
1 parent d956b91 commit 3685a21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions juniper/src/integrations/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

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

Expand Down

0 comments on commit 3685a21

Please sign in to comment.