@@ -10,7 +10,6 @@ use serde::de::{
10
10
} ;
11
11
use std:: fmt;
12
12
use std:: io;
13
- use std:: marker:: PhantomData ;
14
13
use std:: mem;
15
14
use std:: num:: ParseIntError ;
16
15
use std:: str;
@@ -1760,23 +1759,7 @@ pub fn from_str<'de, T>(s: &'de str) -> Result<T>
1760
1759
where
1761
1760
T : Deserialize < ' de > ,
1762
1761
{
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) )
1780
1763
}
1781
1764
1782
1765
/// Deserialize an instance of type `T` from an IO stream of YAML.
@@ -1793,24 +1776,7 @@ where
1793
1776
R : io:: Read ,
1794
1777
T : DeserializeOwned ,
1795
1778
{
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) )
1814
1780
}
1815
1781
1816
1782
/// 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>
1826
1792
where
1827
1793
T : Deserialize < ' de > ,
1828
1794
{
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) )
1846
1796
}
0 commit comments