Fix deserialization by giving type annotations.

This commit is contained in:
Richard Janis Goldschmidt 2016-08-16 00:46:49 +02:00
parent 7339d6cb9a
commit 20360ebccf
1 changed files with 1 additions and 1 deletions

View File

@ -601,7 +601,7 @@ impl<T> serde::Deserialize for Ratio<T>
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
where D: serde::Deserializer
{
let (numer, denom) = try!(serde::Deserialize::deserialize(deserializer));
let (numer, denom): (T,T) = try!(serde::Deserialize::deserialize(deserializer));
if denom.is_zero() {
Err(serde::de::Error::invalid_value("denominator is zero"))
} else {