Skip to content

Commit d7e43aa

Browse files
committed
cleanup warnings from librustdoc
1 parent 50f6198 commit d7e43aa

File tree

6 files changed

+81
-87
lines changed

6 files changed

+81
-87
lines changed

src/librustdoc/config.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -278,102 +278,102 @@ mod test {
278278
279279
#[test]
280280
fn should_error_with_no_crates() {
281-
let config = parse_config(~[~"rustdoc"]);
281+
let config = parse_config([~"rustdoc"]);
282282
assert!(config.get_err() == ~"no crates specified");
283283
}
284284
285285
#[test]
286286
fn should_error_with_multiple_crates() {
287287
let config =
288-
parse_config(~[~"rustdoc", ~"crate1.rc", ~"crate2.rc"]);
288+
parse_config([~"rustdoc", ~"crate1.rc", ~"crate2.rc"]);
289289
assert!(config.get_err() == ~"multiple crates specified");
290290
}
291291
292292
#[test]
293293
fn should_set_output_dir_to_cwd_if_not_provided() {
294-
let config = parse_config(~[~"rustdoc", ~"crate.rc"]);
294+
let config = parse_config([~"rustdoc", ~"crate.rc"]);
295295
assert!(config.get().output_dir == Path("."));
296296
}
297297
298298
#[test]
299299
fn should_set_output_dir_if_provided() {
300-
let config = parse_config(~[
300+
let config = parse_config([
301301
~"rustdoc", ~"crate.rc", ~"--output-dir", ~"snuggles"
302302
]);
303303
assert!(config.get().output_dir == Path("snuggles"));
304304
}
305305
306306
#[test]
307307
fn should_set_output_format_to_pandoc_html_if_not_provided() {
308-
let config = parse_config(~[~"rustdoc", ~"crate.rc"]);
308+
let config = parse_config([~"rustdoc", ~"crate.rc"]);
309309
assert!(config.get().output_format == PandocHtml);
310310
}
311311
312312
#[test]
313313
fn should_set_output_format_to_markdown_if_requested() {
314-
let config = parse_config(~[
314+
let config = parse_config([
315315
~"rustdoc", ~"crate.rc", ~"--output-format", ~"markdown"
316316
]);
317317
assert!(config.get().output_format == Markdown);
318318
}
319319
320320
#[test]
321321
fn should_set_output_format_to_pandoc_html_if_requested() {
322-
let config = parse_config(~[
322+
let config = parse_config([
323323
~"rustdoc", ~"crate.rc", ~"--output-format", ~"html"
324324
]);
325325
assert!(config.get().output_format == PandocHtml);
326326
}
327327
328328
#[test]
329329
fn should_error_on_bogus_format() {
330-
let config = parse_config(~[
330+
let config = parse_config([
331331
~"rustdoc", ~"crate.rc", ~"--output-format", ~"bogus"
332332
]);
333333
assert!(config.get_err() == ~"unknown output format 'bogus'");
334334
}
335335
336336
#[test]
337337
fn should_set_output_style_to_doc_per_mod_by_default() {
338-
let config = parse_config(~[~"rustdoc", ~"crate.rc"]);
338+
let config = parse_config([~"rustdoc", ~"crate.rc"]);
339339
assert!(config.get().output_style == DocPerMod);
340340
}
341341
342342
#[test]
343343
fn should_set_output_style_to_one_doc_if_requested() {
344-
let config = parse_config(~[
344+
let config = parse_config([
345345
~"rustdoc", ~"crate.rc", ~"--output-style", ~"doc-per-crate"
346346
]);
347347
assert!(config.get().output_style == DocPerCrate);
348348
}
349349
350350
#[test]
351351
fn should_set_output_style_to_doc_per_mod_if_requested() {
352-
let config = parse_config(~[
352+
let config = parse_config([
353353
~"rustdoc", ~"crate.rc", ~"--output-style", ~"doc-per-mod"
354354
]);
355355
assert!(config.get().output_style == DocPerMod);
356356
}
357357
358358
#[test]
359359
fn should_error_on_bogus_output_style() {
360-
let config = parse_config(~[
360+
let config = parse_config([
361361
~"rustdoc", ~"crate.rc", ~"--output-style", ~"bogus"
362362
]);
363363
assert!(config.get_err() == ~"unknown output style 'bogus'");
364364
}
365365
366366
#[test]
367367
fn should_set_pandoc_command_if_requested() {
368-
let config = parse_config(~[
368+
let config = parse_config([
369369
~"rustdoc", ~"crate.rc", ~"--pandoc-cmd", ~"panda-bear-doc"
370370
]);
371371
assert!(config.get().pandoc_cmd == Some(~"panda-bear-doc"));
372372
}
373373
374374
#[test]
375375
fn should_set_pandoc_command_when_using_pandoc() {
376-
let config = parse_config(~[~"rustdoc", ~"crate.rc"]);
376+
let config = parse_config([~"rustdoc", ~"crate.rc"]);
377377
assert!(config.get().pandoc_cmd == Some(~"pandoc"));
378378
}
379379
}

src/librustdoc/desc_to_brief_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ mod test {
220220
221221
#[test]
222222
fn test_paragraphs_1() {
223-
let paras = paragraphs(~"1\n\n2");
223+
let paras = paragraphs("1\n\n2");
224224
assert_eq!(paras, ~[~"1", ~"2"]);
225225
}
226226
227227
#[test]
228228
fn test_paragraphs_2() {
229-
let paras = paragraphs(~"\n\n1\n1\n\n2\n\n");
229+
let paras = paragraphs("\n\n1\n1\n\n2\n\n");
230230
assert_eq!(paras, ~[~"1\n1", ~"2"]);
231231
}
232232

src/librustdoc/extract.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ use astsrv;
1616
use doc::ItemUtils;
1717
use doc;
1818

19-
use core::local_data::local_data_get;
2019
use syntax::ast;
21-
use syntax;
2220
use syntax::parse::token::{ident_interner};
2321
use syntax::parse::token;
2422

src/librustdoc/markdown_index_pass.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,21 @@ mod test {
193193

194194
#[test]
195195
fn should_remove_punctuation_from_headers() {
196-
assert!(pandoc_header_id(~"impl foo of bar<A>") ==
196+
assert!(pandoc_header_id("impl foo of bar<A>") ==
197197
~"impl-foo-of-bara");
198-
assert!(pandoc_header_id(~"impl of num::num for int")
198+
assert!(pandoc_header_id("impl of num::num for int")
199199
== ~"impl-of-numnum-for-int");
200-
assert!(pandoc_header_id(~"impl of num::num for int/&")
200+
assert!(pandoc_header_id("impl of num::num for int/&")
201201
== ~"impl-of-numnum-for-int");
202-
assert!(pandoc_header_id(~"impl of num::num for ^int")
202+
assert!(pandoc_header_id("impl of num::num for ^int")
203203
== ~"impl-of-numnum-for-int");
204-
assert!(pandoc_header_id(~"impl for & condvar")
204+
assert!(pandoc_header_id("impl for & condvar")
205205
== ~"impl-for-condvar");
206-
assert!(pandoc_header_id(~"impl of Select<T, U> for (Left, Right)")
206+
assert!(pandoc_header_id("impl of Select<T, U> for (Left, Right)")
207207
== ~"impl-of-selectt-u-for-left-right");
208-
assert!(pandoc_header_id(~"impl of Condition<'self, T, U>")
208+
assert!(pandoc_header_id("impl of Condition<'self, T, U>")
209209
== ~"impl-of-conditionself-t-u");
210-
assert!(pandoc_header_id(~"impl of Condition<T: Copy + Clone>")
210+
assert!(pandoc_header_id("impl of Condition<T: Copy + Clone>")
211211
== ~"impl-of-conditiont-copy-clone");
212212
}
213213

0 commit comments

Comments
 (0)