mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 20:11:02 +00:00
Fix serde2_macros and benchmarks, and silence some warnings
This commit is contained in:
+10
-1
@@ -361,6 +361,15 @@ pub struct PrimitiveVisitor<T> {
|
||||
marker: PhantomData<T>,
|
||||
}
|
||||
|
||||
impl<T> PrimitiveVisitor<T> {
|
||||
#[inline]
|
||||
pub fn new() -> Self {
|
||||
PrimitiveVisitor {
|
||||
marker: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<
|
||||
T: Deserialize + FromPrimitive
|
||||
> self::Visitor for PrimitiveVisitor<T> {
|
||||
@@ -387,7 +396,7 @@ macro_rules! impl_deserialize_num {
|
||||
fn deserialize<
|
||||
D: Deserializer,
|
||||
>(deserializer: &mut D) -> Result<$ty, D::Error> {
|
||||
deserializer.visit(&mut PrimitiveVisitor { marker: PhantomData })
|
||||
deserializer.visit(&mut PrimitiveVisitor::new())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user