Use generic NonZero
internally.
This commit is contained in:
parent
ee9c7c940c
commit
746a58d435
144 changed files with 653 additions and 604 deletions
|
@ -11,6 +11,7 @@
|
|||
#![feature(associated_type_bounds)]
|
||||
#![feature(const_option)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(generic_nonzero)]
|
||||
#![feature(inline_const)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(never_type)]
|
||||
|
|
|
@ -6,6 +6,7 @@ use std::cell::{Cell, RefCell};
|
|||
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque};
|
||||
use std::hash::{BuildHasher, Hash};
|
||||
use std::marker::PhantomData;
|
||||
use std::num::NonZero;
|
||||
use std::path;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
@ -216,15 +217,15 @@ impl<D: Decoder> Decodable<D> for ! {
|
|||
}
|
||||
}
|
||||
|
||||
impl<S: Encoder> Encodable<S> for ::std::num::NonZeroU32 {
|
||||
impl<S: Encoder> Encodable<S> for NonZero<u32> {
|
||||
fn encode(&self, s: &mut S) {
|
||||
s.emit_u32(self.get());
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: Decoder> Decodable<D> for ::std::num::NonZeroU32 {
|
||||
impl<D: Decoder> Decodable<D> for NonZero<u32> {
|
||||
fn decode(d: &mut D) -> Self {
|
||||
::std::num::NonZeroU32::new(d.read_u32()).unwrap()
|
||||
NonZero::<u32>::new(d.read_u32()).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue