Add a comment explaining the lack of Decoder::read_enum_variant.

Because I was wondering about it, and this may save a future person from
also wondering.
This commit is contained in:
Nicholas Nethercote 2023-04-28 08:53:13 +10:00
parent b51deba9ac
commit 37c9e45186

View File

@ -84,6 +84,11 @@ pub trait Decoder {
fn read_char(&mut self) -> char;
fn read_str(&mut self) -> &str;
fn read_raw_bytes(&mut self, len: usize) -> &[u8];
// Although there is an `emit_enum_variant` method in `Encoder`, the code
// patterns in decoding are different enough to encoding that there is no
// need for a corresponding `read_enum_variant` method here.
fn peek_byte(&self) -> u8;
fn position(&self) -> usize;
}