mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-18 01:31:03 +00:00
Use a deserializer in which V would conflict
This commit is contained in:
+18
-6
@@ -192,13 +192,24 @@ macro_rules! forward_to_deserialize_helper {
|
|||||||
/// specified explicitly if necessary.
|
/// specified explicitly if necessary.
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # #[macro_use] extern crate serde;
|
/// # #[macro_use]
|
||||||
|
/// # extern crate serde;
|
||||||
|
/// #
|
||||||
|
/// # use std::marker::PhantomData;
|
||||||
|
/// #
|
||||||
/// # use serde::de::{value, Deserializer, Visitor};
|
/// # use serde::de::{value, Deserializer, Visitor};
|
||||||
/// # pub struct MyDeserializer;
|
/// #
|
||||||
/// # impl<'q> Deserializer<'q> for MyDeserializer {
|
/// # struct MyDeserializer<V>(PhantomData<V>);
|
||||||
/// # type Error = value::Error;
|
/// #
|
||||||
/// # fn deserialize<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
/// # impl<'q, V> Deserializer<'q> for MyDeserializer<V> {
|
||||||
/// # where V: Visitor<'q> { unimplemented!() }
|
/// # type Error = value::Error;
|
||||||
|
/// #
|
||||||
|
/// # fn deserialize<W>(self, visitor: W) -> Result<W::Value, Self::Error>
|
||||||
|
/// # where W: Visitor<'q>
|
||||||
|
/// # {
|
||||||
|
/// # unimplemented!()
|
||||||
|
/// # }
|
||||||
|
/// #
|
||||||
/// forward_to_deserialize! {
|
/// forward_to_deserialize! {
|
||||||
/// <W: Visitor<'q>>
|
/// <W: Visitor<'q>>
|
||||||
/// bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
/// bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||||
@@ -206,6 +217,7 @@ macro_rules! forward_to_deserialize_helper {
|
|||||||
/// tuple_struct struct struct_field tuple enum ignored_any
|
/// tuple_struct struct struct_field tuple enum ignored_any
|
||||||
/// }
|
/// }
|
||||||
/// # }
|
/// # }
|
||||||
|
/// #
|
||||||
/// # fn main() {}
|
/// # fn main() {}
|
||||||
/// ```
|
/// ```
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|||||||
Reference in New Issue
Block a user