@@ -22,7 +22,7 @@ macro_rules! impl_encoding_traits {
2222 const UNSIGNED_HEADROOM : usize = 1 ;
2323
2424 let mut buf = [ 0u8 ; ( Self :: BITS as usize / 8 ) + UNSIGNED_HEADROOM ] ;
25- let max_length = u32 :: from( header. length) as usize ;
25+ let max_length = u32 :: from( header. length( ) ) as usize ;
2626
2727 if max_length == 0 {
2828 return Err ( reader. error( Tag :: Integer . length_error( ) ) ) ;
@@ -36,7 +36,7 @@ macro_rules! impl_encoding_traits {
3636 let result = Self :: from_be_bytes( decode_to_array( bytes) ?) ;
3737
3838 // Ensure we compute the same encoded length as the original any value
39- if header. length != result. value_len( ) ? {
39+ if header. length( ) != result. value_len( ) ? {
4040 return Err ( reader. error( Self :: TAG . non_canonical_error( ) ) ) ;
4141 }
4242
@@ -126,7 +126,7 @@ impl<'a> DecodeValue<'a> for UintRef<'a> {
126126 let result = Self :: new ( decode_to_slice ( bytes) ?) ?;
127127
128128 // Ensure we compute the same encoded length as the original any value.
129- if result. value_len ( ) ? != header. length {
129+ if result. value_len ( ) ? != header. length ( ) {
130130 return Err ( reader. error ( Self :: TAG . non_canonical_error ( ) ) ) ;
131131 }
132132
@@ -221,7 +221,7 @@ mod allocating {
221221 let result = Self :: new ( decode_to_slice ( bytes. as_slice ( ) ) ?) ?;
222222
223223 // Ensure we compute the same encoded length as the original any value.
224- if result. value_len ( ) ? != header. length {
224+ if result. value_len ( ) ? != header. length ( ) {
225225 return Err ( reader. error ( Self :: TAG . non_canonical_error ( ) ) ) ;
226226 }
227227
0 commit comments