Skip to content

Commit 4c89985

Browse files
committed
cbor: tiny doc fixes
1 parent 7d169a5 commit 4c89985

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/cbor/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)