@@ -62,9 +62,7 @@ macro_rules! read_byteorder_utils {
6262 const SIZE : usize = core:: mem:: size_of:: <$tp>( ) ;
6363 let mut buf: [ u8 ; SIZE ] = [ 0u8 ; SIZE ] ;
6464 self . read_exact_buf( & mut buf) . map_err( ValueReadError :: InvalidDataRead ) ?;
65- Ok ( paste:: paste! {
66- <byteorder:: BigEndian as byteorder:: ByteOrder >:: [ <read_ $tp>] ( & mut buf)
67- } )
65+ Ok ( $tp:: from_be_bytes( buf) )
6866 }
6967 ) *
7068 } ;
@@ -83,8 +81,6 @@ mod sealed {
8381/// The methods of this trait should be considered an implementation detail (for now).
8482/// It is currently sealed (can not be implemented by the user).
8583///
86- /// See also [`std::io::Read`] and [`byteorder::ReadBytesExt`]
87- ///
8884/// Its primary implementations are [`std::io::Read`] and [Bytes].
8985pub trait RmpRead : sealed:: Sealed {
9086 type Error : RmpReadErr ;
@@ -130,40 +126,6 @@ pub trait RmpRead: sealed::Sealed {
130126 ) ;
131127}
132128
133- /*
134- * HACK: rmpv & rmp-erde used the internal read_data_* functions.
135- *
136- * Since adding no_std support moved these functions to the RmpRead trait,
137- * this broke compatiblity (despite changing no public APIs).
138- *
139- * In theory, we could update rmpv and rmp-serde to use the new APIS,
140- * but that would be needless churn (and might surprise users who just want to update rmp proper).
141- *
142- * Instead, we emulate these internal APIs for now,
143- * so that rmpv and rmp-serde continue to compile without issue.
144- *
145- *
146- * TODO: Remove this hack once we release a new version of rmp proper
147- */
148-
149- macro_rules! wrap_data_funcs_for_compatibility {
150- ( $( $tp: ident) ,* $( , ) ?) => {
151- $( paste:: paste! {
152- #[ cfg( feature = "std" ) ]
153- #[ doc( hidden) ]
154- #[ deprecated( note = "internal function. rmpv & rmp-serde need to switch to RmpRead" ) ]
155- pub fn [ <read_data_ $tp>] <R : std:: io:: Read >( buf: & mut R ) -> Result <$tp, ValueReadError > {
156- buf. [ <read_data_ $tp>] ( )
157- }
158- } ) *
159- } ;
160- }
161- wrap_data_funcs_for_compatibility ! (
162- u8 , u16 , u32 , u64 ,
163- i8 , i16 , i32 , i64 ,
164- f32 , f64
165- ) ;
166-
167129#[ cfg( feature = "std" ) ]
168130impl < T : std:: io:: Read > RmpRead for T {
169131 type Error = std:: io:: Error ;
0 commit comments