feat(de): Don't expose primitive

This commit is contained in:
Erick Tryzelaar 2016-02-23 19:48:10 -08:00
parent 57433e1eaa
commit f4c8ad6c3a

View File

@ -118,23 +118,23 @@ macro_rules! impl_deserialize_num_method {
} }
/// A visitor that produces a primitive type. /// A visitor that produces a primitive type.
pub struct PrimitiveVisitor<T> { struct PrimitiveVisitor<T> {
marker: PhantomData<T>, marker: PhantomData<T>,
} }
impl<T> PrimitiveVisitor<T> { impl<T> PrimitiveVisitor<T> {
/// Construct a new `PrimitiveVisitor`. /// Construct a new `PrimitiveVisitor`.
#[inline] #[inline]
pub fn new() -> Self { fn new() -> Self {
PrimitiveVisitor { PrimitiveVisitor {
marker: PhantomData, marker: PhantomData,
} }
} }
} }
impl< impl<T> Visitor for PrimitiveVisitor<T>
T: Deserialize + FromPrimitive + str::FromStr where T: Deserialize + FromPrimitive + str::FromStr
> Visitor for PrimitiveVisitor<T> { {
type Value = T; type Value = T;
impl_deserialize_num_method!(isize, visit_isize, from_isize, Type::Isize); impl_deserialize_num_method!(isize, visit_isize, from_isize, Type::Isize);