Suppress warning about using num::Zero
This commit is contained in:
parent
530c29466e
commit
089c7eb1d7
@ -60,6 +60,7 @@ use std::time::Duration;
|
|||||||
use core::nonzero::{NonZero, Zeroable};
|
use core::nonzero::{NonZero, Zeroable};
|
||||||
|
|
||||||
#[cfg(feature = "unstable")]
|
#[cfg(feature = "unstable")]
|
||||||
|
#[allow(deprecated)] // required for impl Deserialize for NonZero<T>
|
||||||
use core::num::Zero;
|
use core::num::Zero;
|
||||||
|
|
||||||
use de::{
|
use de::{
|
||||||
@ -1079,6 +1080,7 @@ impl Deserialize for Duration {
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[cfg(feature = "unstable")]
|
#[cfg(feature = "unstable")]
|
||||||
|
#[allow(deprecated)] // num::Zero is deprecated but there is no replacement
|
||||||
impl<T> Deserialize for NonZero<T> where T: Deserialize + PartialEq + Zeroable + Zero {
|
impl<T> Deserialize for NonZero<T> where T: Deserialize + PartialEq + Zeroable + Zero {
|
||||||
fn deserialize<D>(deserializer: D) -> Result<NonZero<T>, D::Error> where D: Deserializer {
|
fn deserialize<D>(deserializer: D) -> Result<NonZero<T>, D::Error> where D: Deserializer {
|
||||||
let value = try!(Deserialize::deserialize(deserializer));
|
let value = try!(Deserialize::deserialize(deserializer));
|
||||||
|
Loading…
Reference in New Issue
Block a user