std: remove Encoder::emit_tup{,_elt} and Decoder::read_tup{,_elt}
This commit is contained in:
parent
590bbcebe9
commit
e99cdcfba8
4 changed files with 0 additions and 57 deletions
|
@ -158,13 +158,6 @@ impl serialize::Encoder for Encoder {
|
|||
f();
|
||||
}
|
||||
|
||||
fn emit_tup(&self, len: uint, f: &fn()) {
|
||||
self.emit_seq(len, f);
|
||||
}
|
||||
fn emit_tup_elt(&self, idx: uint, f: &fn()) {
|
||||
self.emit_seq_elt(idx, f)
|
||||
}
|
||||
|
||||
fn emit_option(&self, f: &fn()) { f(); }
|
||||
fn emit_option_none(&self) { self.emit_nil(); }
|
||||
fn emit_option_some(&self, f: &fn()) { f(); }
|
||||
|
@ -287,12 +280,6 @@ impl serialize::Encoder for PrettyEncoder {
|
|||
self.wr.write_str(": ");
|
||||
f();
|
||||
}
|
||||
fn emit_tup(&self, sz: uint, f: &fn()) {
|
||||
self.emit_seq(sz, f);
|
||||
}
|
||||
fn emit_tup_elt(&self, idx: uint, f: &fn()) {
|
||||
self.emit_seq_elt(idx, f)
|
||||
}
|
||||
|
||||
fn emit_option(&self, f: &fn()) { f(); }
|
||||
fn emit_option_none(&self) { self.emit_nil(); }
|
||||
|
@ -905,24 +892,6 @@ impl<'self> serialize::Decoder for Decoder<'self> {
|
|||
}
|
||||
}
|
||||
|
||||
fn read_tup<T>(&self, len: uint, f: &fn() -> T) -> T {
|
||||
debug!("read_tup(len=%u)", len);
|
||||
let value = f();
|
||||
self.pop();
|
||||
value
|
||||
}
|
||||
|
||||
fn read_tup_elt<T>(&self, idx: uint, f: &fn() -> T) -> T {
|
||||
debug!("read_tup_elt(idx=%u)", idx);
|
||||
match *self.peek() {
|
||||
List(ref list) => {
|
||||
self.stack.push(&list[idx]);
|
||||
f()
|
||||
}
|
||||
_ => fail!(~"not a list")
|
||||
}
|
||||
}
|
||||
|
||||
fn read_option<T>(&self, f: &fn(bool) -> T) -> T {
|
||||
match *self.peek() {
|
||||
Null => { self.pop(); f(false) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue