mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
auto merge of #17504 : danburkert/rust/tuple-serialization, r=alexcrichton
The tuple serialization logic should be using the tuple-specific emit function. This fixes part of #17158. The JSON encoder already proxies to `emit_seq_elt` when `emit_tuple_arg` is called, so this should have an effect.
This commit is contained in:
@@ -503,7 +503,7 @@ fn encode(&self, s: &mut S) -> Result<(), E> {
|
||||
$(let $name = $name; n += 1;)*
|
||||
s.emit_tuple(n, |s| {
|
||||
let mut i = 0;
|
||||
$(try!(s.emit_seq_elt({ i+=1; i-1 }, |s| $name.encode(s)));)*
|
||||
$(try!(s.emit_tuple_arg({ i+=1; i-1 }, |s| $name.encode(s)));)*
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user