@@ -10,7 +10,6 @@ use serde::de::{
1010} ;
1111use std:: fmt;
1212use std:: io;
13- use std:: marker:: PhantomData ;
1413use std:: mem;
1514use std:: num:: ParseIntError ;
1615use std:: str;
@@ -1760,23 +1759,7 @@ pub fn from_str<'de, T>(s: &'de str) -> Result<T>
17601759where
17611760 T : Deserialize < ' de > ,
17621761{
1763- from_str_seed ( s, PhantomData )
1764- }
1765-
1766- /// Deserialize an instance of type `T` from a string of YAML text with a seed.
1767- ///
1768- /// This conversion can fail if the structure of the Value does not match the
1769- /// structure expected by `T`, for example if `T` is a struct type but the Value
1770- /// contains something other than a YAML map. It can also fail if the structure
1771- /// is correct but `T`'s implementation of `Deserialize` decides that something
1772- /// is wrong with the data, for example required struct fields are missing from
1773- /// the YAML map or some number is too big to fit in the expected primitive
1774- /// type.
1775- pub fn from_str_seed < ' de , T , S > ( s : & ' de str , seed : S ) -> Result < T >
1776- where
1777- S : DeserializeSeed < ' de , Value = T > ,
1778- {
1779- seed. deserialize ( Deserializer :: from_str ( s) )
1762+ T :: deserialize ( Deserializer :: from_str ( s) )
17801763}
17811764
17821765/// Deserialize an instance of type `T` from an IO stream of YAML.
@@ -1793,24 +1776,7 @@ where
17931776 R : io:: Read ,
17941777 T : DeserializeOwned ,
17951778{
1796- from_reader_seed ( rdr, PhantomData )
1797- }
1798-
1799- /// Deserialize an instance of type `T` from an IO stream of YAML with a seed.
1800- ///
1801- /// This conversion can fail if the structure of the Value does not match the
1802- /// structure expected by `T`, for example if `T` is a struct type but the Value
1803- /// contains something other than a YAML map. It can also fail if the structure
1804- /// is correct but `T`'s implementation of `Deserialize` decides that something
1805- /// is wrong with the data, for example required struct fields are missing from
1806- /// the YAML map or some number is too big to fit in the expected primitive
1807- /// type.
1808- pub fn from_reader_seed < R , T , S > ( rdr : R , seed : S ) -> Result < T >
1809- where
1810- R : io:: Read ,
1811- S : for < ' de > DeserializeSeed < ' de , Value = T > ,
1812- {
1813- seed. deserialize ( Deserializer :: from_reader ( rdr) )
1779+ T :: deserialize ( Deserializer :: from_reader ( rdr) )
18141780}
18151781
18161782/// Deserialize an instance of type `T` from bytes of YAML text.
@@ -1826,21 +1792,5 @@ pub fn from_slice<'de, T>(v: &'de [u8]) -> Result<T>
18261792where
18271793 T : Deserialize < ' de > ,
18281794{
1829- from_slice_seed ( v, PhantomData )
1830- }
1831-
1832- /// Deserialize an instance of type `T` from bytes of YAML text with a seed.
1833- ///
1834- /// This conversion can fail if the structure of the Value does not match the
1835- /// structure expected by `T`, for example if `T` is a struct type but the Value
1836- /// contains something other than a YAML map. It can also fail if the structure
1837- /// is correct but `T`'s implementation of `Deserialize` decides that something
1838- /// is wrong with the data, for example required struct fields are missing from
1839- /// the YAML map or some number is too big to fit in the expected primitive
1840- /// type.
1841- pub fn from_slice_seed < ' de , T , S > ( v : & ' de [ u8 ] , seed : S ) -> Result < T >
1842- where
1843- S : DeserializeSeed < ' de , Value = T > ,
1844- {
1845- seed. deserialize ( Deserializer :: from_slice ( v) )
1795+ T :: deserialize ( Deserializer :: from_slice ( v) )
18461796}
0 commit comments