Skip to content

Commit 37c9e45

Browse files
committed
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.
1 parent b51deba commit 37c9e45

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_serialize/src/serialize.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ pub trait Decoder {
8484
fn read_char(&mut self) -> char;
8585
fn read_str(&mut self) -> &str;
8686
fn read_raw_bytes(&mut self, len: usize) -> &[u8];
87+
88+
// Although there is an `emit_enum_variant` method in `Encoder`, the code
89+
// patterns in decoding are different enough to encoding that there is no
90+
// need for a corresponding `read_enum_variant` method here.
91+
8792
fn peek_byte(&self) -> u8;
8893
fn position(&self) -> usize;
8994
}

0 commit comments

Comments
 (0)