Skip to content

Commit ee25cf8

Browse files
committed
std: test-fixes, remove warnings, syntax highlighting for code examples.
1 parent 4686ed1 commit ee25cf8

File tree

11 files changed

+12
-28
lines changed

11 files changed

+12
-28
lines changed

src/compiletest/runtest.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use util::logv;
2424

2525
use core::io;
2626
use core::os;
27-
use core::str;
2827
use core::uint;
2928
use core::vec;
3029

src/librustdoc/astsrv.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ use syntax::ast;
3232
use syntax::ast_map;
3333
use syntax;
3434

35-
#[cfg(test)] use core::vec;
36-
3735
pub struct Ctxt {
3836
ast: @ast::crate,
3937
ast_map: ast_map::map

src/librustdoc/desc_to_brief_pass.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,12 @@ fn first_sentence_(s: &str) -> ~str {
129129
}
130130
});
131131
match idx {
132-
Some(idx) if idx > 2u => {
133-
str::to_owned(s.slice(0, idx - 1))
134-
}
132+
Some(idx) if idx > 2u => s.slice(0, idx - 1).to_owned(),
135133
_ => {
136134
if s.ends_with(".") {
137-
str::to_owned(s)
135+
s.to_owned()
138136
} else {
139-
str::to_owned(s)
137+
s.to_owned()
140138
}
141139
}
142140
}

src/librustdoc/extract.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,6 @@ mod test {
285285
use extract::{extract, from_srv};
286286
use parse;
287287

288-
use core::vec;
289-
290288
fn mk_doc(source: @str) -> doc::Doc {
291289
let ast = parse::from_str(source);
292290
extract(ast, ~"")

src/librustdoc/markdown_pass.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,6 @@ mod test {
537537
use tystr_pass;
538538
use unindent_pass;
539539

540-
use core::str;
541-
542540
fn render(source: ~str) -> ~str {
543541
let (srv, doc) = create_doc_srv(source);
544542
let markdown = write_markdown_str_srv(srv, doc);

src/librustdoc/page_pass.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ mod test {
157157
use doc;
158158
use extract;
159159
use page_pass::run;
160-
use core::vec;
161160

162161
fn mk_doc_(
163162
output_style: config::OutputStyle,

src/librustdoc/prune_hidden_pass.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ mod test {
7777

7878
#[test]
7979
fn should_prune_hidden_items() {
80-
use core::vec;
81-
8280
let doc = mk_doc(~"#[doc(hidden)] mod a { }");
8381
assert!(doc.cratemod().mods().is_empty())
8482
}

src/librustdoc/prune_private_pass.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ mod test {
162162
use extract;
163163
use tystr_pass;
164164
use prune_private_pass::run;
165-
use core::vec;
166165

167166
fn mk_doc(source: ~str) -> doc::Doc {
168167
do astsrv::from_str(copy source) |srv| {

src/librustdoc/sectionalize_pass.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ mod test {
170170
use extract;
171171
use sectionalize_pass::run;
172172

173-
use core::str;
174-
use core::vec;
175-
176173
fn mk_doc(source: ~str) -> doc::Doc {
177174
do astsrv::from_str(copy source) |srv| {
178175
let doc = extract::from_srv(srv.clone(), ~"");

src/libstd/path.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ impl GenericPath for PosixPath {
515515
fn with_filestem(&self, s: &str) -> PosixPath {
516516
match self.filetype() {
517517
None => self.with_filename(s),
518-
Some(ref t) => self.with_filename(str::to_owned(s) + *t),
518+
Some(ref t) => self.with_filename(s.to_owned() + *t),
519519
}
520520
}
521521

@@ -657,7 +657,7 @@ impl GenericPath for WindowsPath {
657657
(None, None) => {
658658
host = None;
659659
device = None;
660-
rest = str::to_owned(s);
660+
rest = s.to_owned();
661661
}
662662
}
663663

@@ -729,7 +729,7 @@ impl GenericPath for WindowsPath {
729729
fn with_filestem(&self, s: &str) -> WindowsPath {
730730
match self.filetype() {
731731
None => self.with_filename(s),
732-
Some(ref t) => self.with_filename(str::to_owned(s) + *t),
732+
Some(ref t) => self.with_filename(s.to_owned() + *t),
733733
}
734734
}
735735

@@ -984,7 +984,7 @@ mod tests {
984984
fn test_posix_paths() {
985985
fn t(wp: &PosixPath, s: &str) {
986986
let ss = wp.to_str();
987-
let sss = str::to_owned(s);
987+
let sss = s.to_owned();
988988
if (ss != sss) {
989989
debug!("got %s", ss);
990990
debug!("expected %s", sss);
@@ -1042,7 +1042,7 @@ mod tests {
10421042
fn test_normalize() {
10431043
fn t(wp: &PosixPath, s: &str) {
10441044
let ss = wp.to_str();
1045-
let sss = str::to_owned(s);
1045+
let sss = s.to_owned();
10461046
if (ss != sss) {
10471047
debug!("got %s", ss);
10481048
debug!("expected %s", sss);
@@ -1105,7 +1105,7 @@ mod tests {
11051105
fn test_windows_paths() {
11061106
fn t(wp: &WindowsPath, s: &str) {
11071107
let ss = wp.to_str();
1108-
let sss = str::to_owned(s);
1108+
let sss = s.to_owned();
11091109
if (ss != sss) {
11101110
debug!("got %s", ss);
11111111
debug!("expected %s", sss);

0 commit comments

Comments
 (0)