File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -143,9 +143,8 @@ impl Encoder {
143143 self . encode_length ( MAJOR_MAP , len as u64 ) ;
144144 }
145145
146- // encode_length encodes a major type, injecting an unsigned integer after,
147- // which will for most types define the length. For integers, it will simply
148- // be the value itself.
146+ // encodeLength encodes a major type with an unsigned integer, which defines
147+ // the length for most types, or the value itself for integers.
149148 fn encode_length ( & mut self , major_type : u8 , len : u64 ) {
150149 if len < 24 {
151150 self . buf . push ( major_type << 5 | len as u8 ) ;
@@ -185,7 +184,7 @@ impl<'a> Decoder<'a> {
185184 Self { data, pos : 0 }
186185 }
187186
188- // finish terminates decoding and returns whether trailing bytes linger .
187+ // finish terminates decoding and returns an error if trailing bytes remain .
189188 pub fn finish ( self ) -> Result < ( ) , Error > {
190189 if self . pos != self . data . len ( ) {
191190 return Err ( Error :: TrailingBytes ) ;
You can’t perform that action at this time.
0 commit comments