@@ -130,19 +130,13 @@ impl serialize::Encoder for Encoder {
130130 f ( ) ;
131131 }
132132
133- fn emit_borrowed_vec ( & self , _len : uint , f : & fn ( ) ) {
133+ fn emit_seq ( & self , _len : uint , f : & fn ( ) ) {
134134 self . wr . write_char ( '[' ) ;
135135 f ( ) ;
136136 self . wr . write_char ( ']' ) ;
137137 }
138138
139- fn emit_owned_vec ( & self , len : uint , f : & fn ( ) ) {
140- self . emit_borrowed_vec ( len, f)
141- }
142- fn emit_managed_vec ( & self , len : uint , f : & fn ( ) ) {
143- self . emit_borrowed_vec ( len, f)
144- }
145- fn emit_vec_elt ( & self , idx : uint , f : & fn ( ) ) {
139+ fn emit_seq_elt ( & self , idx : uint , f : & fn ( ) ) {
146140 if idx != 0 { self . wr . write_char ( ',' ) ; }
147141 f ( )
148142 }
@@ -165,10 +159,10 @@ impl serialize::Encoder for Encoder {
165159 }
166160
167161 fn emit_tup ( & self , len : uint , f : & fn ( ) ) {
168- self . emit_borrowed_vec ( len, f) ;
162+ self . emit_seq ( len, f) ;
169163 }
170164 fn emit_tup_elt ( & self , idx : uint , f : & fn ( ) ) {
171- self . emit_vec_elt ( idx, f)
165+ self . emit_seq_elt ( idx, f)
172166 }
173167
174168 fn emit_option ( & self , f : & fn ( ) ) { f ( ) ; }
@@ -243,7 +237,7 @@ impl serialize::Encoder for PrettyEncoder {
243237 f ( )
244238 }
245239
246- fn emit_borrowed_vec ( & self , len : uint , f : & fn ( ) ) {
240+ fn emit_seq ( & self , len : uint , f : & fn ( ) ) {
247241 if len == 0 {
248242 self . wr . write_str ( "[]" ) ;
249243 } else {
@@ -256,13 +250,7 @@ impl serialize::Encoder for PrettyEncoder {
256250 self . wr . write_char ( ']' ) ;
257251 }
258252 }
259- fn emit_owned_vec ( & self , len : uint , f : & fn ( ) ) {
260- self . emit_borrowed_vec ( len, f)
261- }
262- fn emit_managed_vec ( & self , len : uint , f : & fn ( ) ) {
263- self . emit_borrowed_vec ( len, f)
264- }
265- fn emit_vec_elt ( & self , idx : uint , f : & fn ( ) ) {
253+ fn emit_seq_elt ( & self , idx : uint , f : & fn ( ) ) {
266254 if idx == 0 {
267255 self . wr . write_char ( '\n' ) ;
268256 } else {
@@ -300,10 +288,10 @@ impl serialize::Encoder for PrettyEncoder {
300288 f ( ) ;
301289 }
302290 fn emit_tup ( & self , sz : uint , f : & fn ( ) ) {
303- self . emit_borrowed_vec ( sz, f) ;
291+ self . emit_seq ( sz, f) ;
304292 }
305293 fn emit_tup_elt ( & self , idx : uint , f : & fn ( ) ) {
306- self . emit_vec_elt ( idx, f)
294+ self . emit_seq_elt ( idx, f)
307295 }
308296
309297 fn emit_option ( & self , f : & fn ( ) ) { f ( ) ; }
@@ -858,19 +846,8 @@ impl<'self> serialize::Decoder for Decoder<'self> {
858846 }
859847 }
860848
861- fn read_owned_vec<T>(&self, f: &fn(uint) -> T) -> T {
862- debug!(" read_owned_vec( ) ");
863- let len = match *self.peek() {
864- List(ref list) => list.len(),
865- _ => fail!(~" not a list"),
866- };
867- let res = f(len);
868- self.pop();
869- res
870- }
871-
872- fn read_managed_vec<T>(&self, f: &fn(uint) -> T) -> T {
873- debug!(" read_owned_vec( ) ");
849+ fn read_seq<T>(&self, f: &fn(uint) -> T) -> T {
850+ debug!(" read_seq( ) ");
874851 let len = match *self.peek() {
875852 List(ref list) => list.len(),
876853 _ => fail!(~" not a list"),
@@ -880,8 +857,8 @@ impl<'self> serialize::Decoder for Decoder<'self> {
880857 res
881858 }
882859
883- fn read_vec_elt <T>(&self, idx: uint, f: &fn() -> T) -> T {
884- debug!(" read_vec_elt ( idx=%u) ", idx);
860+ fn read_seq_elt <T>(&self, idx: uint, f: &fn() -> T) -> T {
861+ debug!(" read_seq_elt ( idx=%u) ", idx);
885862 match *self.peek() {
886863 List(ref list) => {
887864 self.stack.push(&list[idx]);
0 commit comments