Skip to content

Commit 394f8ee

Browse files
committed
tidy
1 parent fe82374 commit 394f8ee

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/libstd/json.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,21 @@ pub impl Encoder: serialize::Encoder {
121121
fn emit_owned(&self, f: fn()) { f() }
122122
fn emit_managed(&self, f: fn()) { f() }
123123

124-
fn emit_enum(&self, name: &str, f: fn()) {
124+
fn emit_enum(&self, _name: &str, f: fn()) {
125125
f()
126126
}
127-
128-
fn emit_enum_variant(&self, _name: &str, id: uint, _cnt: uint, f: fn()) {
127+
128+
fn emit_enum_variant(&self, name: &str, _id: uint, _cnt: uint, f: fn()) {
129129
// emitting enums as arrays where the first
130130
// element provides the enum variant name
131131
self.wr.write_char('[');
132-
self.wr.write_str(escape_str(_name));
132+
self.wr.write_str(escape_str(name));
133133
self.wr.write_char(',');
134134
f();
135135
self.wr.write_char(']');
136136
}
137-
fn emit_enum_variant_arg(&self, _idx: uint, f: fn()) {
138-
if _idx != 0 {self.wr.write_char(',');}
137+
fn emit_enum_variant_arg(&self, idx: uint, f: fn()) {
138+
if idx != 0 {self.wr.write_char(',');}
139139
f();
140140
}
141141

src/libsyntax/ext/auto_encode.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,8 +1160,7 @@ mod test {
11601160
use core::io;
11611161
use core::str;
11621162
use std;
1163-
1164-
1163+
11651164
#[auto_decode]
11661165
#[auto_encode]
11671166
struct Node {id: uint}
@@ -1171,9 +1170,11 @@ mod test {
11711170
val.encode(~std::json::Encoder(bw as io::Writer));
11721171
str::from_bytes(bw.bytes.data)
11731172
}
1174-
1173+
11751174
#[test] fn encode_test () {
1176-
check_equal (to_json_str(Node{id:34} as Encodable::<std::json::Encoder>),~"{\"id\":34}");
1175+
check_equal (to_json_str(Node{id:34}
1176+
as Encodable::<std::json::Encoder>),
1177+
~"{\"id\":34}");
11771178
}
11781179
11791180
#[auto_encode]
@@ -1185,7 +1186,8 @@ mod test {
11851186
#[test] fn json_enum_encode_test () {
11861187
check_equal (to_json_str(Book(9) as Encodable::<std::json::Encoder>),
11871188
~"[\"Book\",9]");
1188-
check_equal (to_json_str(Magazine(~"Paris Match") as Encodable::<std::json::Encoder>),
1189+
check_equal (to_json_str(Magazine(~"Paris Match")
1190+
as Encodable::<std::json::Encoder>),
11891191
~"[\"Magazine\",\"Paris Match\"]");
11901192
}
11911193
}

0 commit comments

Comments
 (0)