json tidy
This commit is contained in:
parent
c952c04462
commit
7736ed6c62
1 changed files with 6 additions and 4 deletions
|
@ -132,7 +132,7 @@ pub impl Encoder: serialize::Encoder {
|
||||||
|
|
||||||
// other enums are encoded as vectors:
|
// other enums are encoded as vectors:
|
||||||
// Kangaroo(34,"William") => ["Kangaroo",[34,"William"]]
|
// Kangaroo(34,"William") => ["Kangaroo",[34,"William"]]
|
||||||
|
|
||||||
// the default expansion for enums is more verbose than I'd like;
|
// the default expansion for enums is more verbose than I'd like;
|
||||||
// specifically, the inner pair of brackets seems superfluous,
|
// specifically, the inner pair of brackets seems superfluous,
|
||||||
// BUT the design of the enumeration framework and the requirements
|
// BUT the design of the enumeration framework and the requirements
|
||||||
|
@ -140,10 +140,11 @@ pub impl Encoder: serialize::Encoder {
|
||||||
// be encoded "naked"--with no commas--and that the option name
|
// be encoded "naked"--with no commas--and that the option name
|
||||||
// can't be followed by just a comma, because there might not
|
// can't be followed by just a comma, because there might not
|
||||||
// be any elements in the tuple.
|
// be any elements in the tuple.
|
||||||
|
|
||||||
// FIXME : this would be more precise and less frightening
|
// this would be more precise and less frightening
|
||||||
// with fully-qualified option names. To get that information,
|
// with fully-qualified option names. To get that information,
|
||||||
// we'd have to change the expansion of auto-encode to pass those along.
|
// we'd have to change the expansion of auto-encode to pass
|
||||||
|
// those along.
|
||||||
|
|
||||||
if (name == ~"Some") {
|
if (name == ~"Some") {
|
||||||
f();
|
f();
|
||||||
|
@ -170,6 +171,7 @@ pub impl Encoder: serialize::Encoder {
|
||||||
f();
|
f();
|
||||||
self.wr.write_char(']');
|
self.wr.write_char(']');
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_owned_vec(&self, len: uint, f: fn()) {
|
fn emit_owned_vec(&self, len: uint, f: fn()) {
|
||||||
self.emit_borrowed_vec(len, f)
|
self.emit_borrowed_vec(len, f)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue