@@ -833,7 +833,7 @@ impl fmt::Display for Error {
833833
834834/// Deserializes an instance of type `T` from bytes of JSON text, using the provided buffer to unescape strings
835835/// Returns the value and the number of bytes consumed in the process
836- pub fn from_slice_using_string_unescape_buffer < ' a , T > (
836+ pub fn from_slice_escaped < ' a , T > (
837837 v : & ' a [ u8 ] ,
838838 string_unescape_buffer : & mut [ u8 ] ,
839839) -> Result < ( T , usize ) >
@@ -853,7 +853,7 @@ pub fn from_slice<'a, T>(v: &'a [u8]) -> Result<(T, usize)>
853853where
854854 T : de:: Deserialize < ' a > ,
855855{
856- from_slice_using_string_unescape_buffer ( v, & mut [ ] ) . map_err ( |error| {
856+ from_slice_escaped ( v, & mut [ ] ) . map_err ( |error| {
857857 if let Error :: EscapedStringIsTooLong = error {
858858 Error :: EscapedStringRequiresBuffer
859859 } else {
@@ -863,14 +863,11 @@ where
863863}
864864
865865/// Deserializes an instance of type T from a string of JSON text, using the provided buffer to unescape strings
866- pub fn from_str_using_string_unescape_buffer < ' a , T > (
867- s : & ' a str ,
868- string_unescape_buffer : & mut [ u8 ] ,
869- ) -> Result < ( T , usize ) >
866+ pub fn from_str_escaped < ' a , T > ( s : & ' a str , string_unescape_buffer : & mut [ u8 ] ) -> Result < ( T , usize ) >
870867where
871868 T : de:: Deserialize < ' a > ,
872869{
873- from_slice_using_string_unescape_buffer ( s. as_bytes ( ) , string_unescape_buffer)
870+ from_slice_escaped ( s. as_bytes ( ) , string_unescape_buffer)
874871}
875872
876873/// Deserializes an instance of type T from a string of JSON text
@@ -949,7 +946,7 @@ mod tests {
949946 fn from_str_test < ' de , T : serde:: Deserialize < ' de > > (
950947 s : & ' de str ,
951948 ) -> super :: Result < ( T , usize ) > {
952- crate :: from_str_using_string_unescape_buffer ( s, & mut [ 0 ; 8 ] )
949+ crate :: from_str_escaped ( s, & mut [ 0 ; 8 ] )
953950 }
954951
955952 assert_eq ! ( from_str_test( r#""n""# ) , Ok ( ( 'n' , 3 ) ) ) ;
@@ -981,7 +978,7 @@ mod tests {
981978 fn from_str_test < ' de , T : serde:: Deserialize < ' de > > (
982979 s : & ' de str ,
983980 ) -> super :: Result < ( T , usize ) > {
984- crate :: from_str_using_string_unescape_buffer ( s, & mut [ 0 ; 16 ] )
981+ crate :: from_str_escaped ( s, & mut [ 0 ; 16 ] )
985982 }
986983
987984 // escaped " in the string content
@@ -1027,7 +1024,7 @@ mod tests {
10271024 fn from_str_test < ' de , T : serde:: Deserialize < ' de > > (
10281025 s : & ' de str ,
10291026 ) -> super :: Result < ( T , usize ) > {
1030- crate :: from_str_using_string_unescape_buffer ( s, & mut [ 0 ; 16 ] )
1027+ crate :: from_str_escaped ( s, & mut [ 0 ; 16 ] )
10311028 }
10321029
10331030 // The combined length of the first and third strings are longer than the buffer, but that's OK,
0 commit comments