@@ -92,7 +92,7 @@ fn run_json_tests<T: ToJson>(json_data: &str, parse: |input: ~str| -> T) {
9292#[test]
9393fn component_value_list() {
9494 run_json_tests(include_str!(" css-parsing-tests/component_value_list. json"), |input| {
95- tokenize(input).map(|(c, _)| c).to_owned_vec ()
95+ tokenize(input).map(|(c, _)| c).collect::<~[ComponentValue]> ()
9696 });
9797}
9898
@@ -108,7 +108,7 @@ fn one_component_value() {
108108#[test]
109109fn declaration_list() {
110110 run_json_tests(include_str!(" css-parsing-tests/declaration_list. json"), |input| {
111- parse_declaration_list(tokenize(input)).to_owned_vec ()
111+ parse_declaration_list(tokenize(input)).collect::<~[Result<DeclarationListItem, SyntaxError>]> ()
112112 });
113113}
114114
@@ -124,15 +124,15 @@ fn one_declaration() {
124124#[test]
125125fn rule_list() {
126126 run_json_tests(include_str!(" css-parsing-tests/rule_list. json"), |input| {
127- parse_rule_list(tokenize(input)).to_owned_vec ()
127+ parse_rule_list(tokenize(input)).collect::<~[Result<Rule, SyntaxError>]> ()
128128 });
129129}
130130
131131
132132#[test]
133133fn stylesheet() {
134134 run_json_tests(include_str!(" css-parsing-tests/stylesheet. json"), |input| {
135- parse_stylesheet_rules(tokenize(input)).to_owned_vec ()
135+ parse_stylesheet_rules(tokenize(input)).collect::<~[Result<Rule, SyntaxError>]> ()
136136 });
137137}
138138
@@ -158,15 +158,15 @@ fn stylesheet_from_bytes() {
158158 let css = get_string(map, &~" css_bytes").unwrap().chars().map(|c| {
159159 assert!(c as u32 <= 0xFF);
160160 c as u8
161- }).to_owned_vec ();
161+ }).collect::<~[u8]> ();
162162 let protocol_encoding_label = get_string(map, &~" protocol_encoding");
163163 let environment_encoding = get_string(map, &~" environment_encoding")
164164 .and_then(encoding_from_whatwg_label);
165165
166166 let (mut rules, used_encoding) = parse_stylesheet_rules_from_bytes(
167167 css, protocol_encoding_label, environment_encoding);
168168
169- (rules.to_owned_vec (), used_encoding.name().to_owned()).to_json()
169+ (rules.collect::<~[Result<Rule, SyntaxError>]> (), used_encoding.name().to_owned()).to_json()
170170 };
171171 assert_json_eq(result, expected, json::Object(map).to_str());
172172 });
@@ -242,17 +242,17 @@ fn bench_color_lookup_fail(b: &mut test::BenchHarness) {
242242#[test]
243243fn nth() {
244244 run_json_tests(include_str!(" css-parsing-tests/An +B . json"), |input| {
245- parse_nth(tokenize(input).map(|(c, _)| c).to_owned_vec ())
245+ parse_nth(tokenize(input).map(|(c, _)| c).collect::<~[ComponentValue]> ())
246246 });
247247}
248248
249249
250250#[test]
251251fn serializer() {
252252 run_json_tests(include_str!(" css-parsing-tests/component_value_list. json"), |input| {
253- let component_values = tokenize(input).map(|(c, _)| c).to_owned_vec ();
253+ let component_values = tokenize(input).map(|(c, _)| c).collect::<~[ComponentValue]> ();
254254 let serialized = component_values.iter().to_css();
255- tokenize(serialized).map(|(c, _)| c).to_owned_vec ()
255+ tokenize(serialized).map(|(c, _)| c).collect::<~[ComponentValue]> ()
256256 });
257257}
258258
@@ -339,11 +339,11 @@ impl ToJson for DeclarationListItem {
339339
340340
341341fn list_to_json(list: &~[(ComponentValue, SourceLocation)]) -> ~[json::Json] {
342- list.map(|tuple| {
342+ list.iter(). map(|tuple| {
343343 match *tuple {
344344 (ref c, _) => c.to_json()
345345 }
346- })
346+ }).collect()
347347}
348348
349349
@@ -426,11 +426,12 @@ impl ToJson for ComponentValue {
426426 CDC => JString(~" -->"),
427427
428428 Function(ref name, ref arguments)
429- => JList(~[JString(~" function"), name.to_json()] + arguments.map(|a| a.to_json())),
429+ => JList(~[JString(~" function"), name.to_json()] +
430+ arguments.iter().map(|a| a.to_json()).collect::<~[json::Json]>()),
430431 ParenthesisBlock(ref content)
431- => JList(~[JString(~" ( ) ")] + content.map(|c| c.to_json())),
432+ => JList(~[JString(~" ( ) ")] + content.iter(). map(|c| c.to_json()).collect::<~[json::Json]>( )),
432433 SquareBracketBlock(ref content)
433- => JList(~[JString(~" [ ] ")] + content.map(|c| c.to_json())),
434+ => JList(~[JString(~" [ ] ")] + content.iter(). map(|c| c.to_json()).collect::<~[json::Json]>( )),
434435 CurlyBracketBlock(ref content)
435436 => JList(~[JString(~" { } ")] + list_to_json(content)),
436437
0 commit comments