]> git.lizzy.rs Git - rust.git/commitdiff
std: test-fixes, remove warnings, syntax highlighting for code examples.
authorHuon Wilson <dbau.pp+github@gmail.com>
Fri, 14 Jun 2013 03:43:05 +0000 (13:43 +1000)
committerHuon Wilson <dbau.pp+github@gmail.com>
Sun, 16 Jun 2013 00:50:28 +0000 (10:50 +1000)
src/compiletest/runtest.rs
src/librustdoc/astsrv.rs
src/librustdoc/desc_to_brief_pass.rs
src/librustdoc/extract.rs
src/librustdoc/markdown_pass.rs
src/librustdoc/page_pass.rs
src/librustdoc/prune_hidden_pass.rs
src/librustdoc/prune_private_pass.rs
src/librustdoc/sectionalize_pass.rs
src/libstd/path.rs
src/libstd/str.rs

index 891935dcadd0c02f4b57bb4d8025f6bbbf5f1d75..e0ceb79a37dfc31de5520d57dc465d387a40b83e 100644 (file)
@@ -24,7 +24,6 @@
 
 use core::io;
 use core::os;
-use core::str;
 use core::uint;
 use core::vec;
 
index 9d8f750a3500638690dff0daf8902029aa8d31e5..3775aafb56969539cddb3e9e19cb545393decb07 100644 (file)
@@ -32,8 +32,6 @@
 use syntax::ast_map;
 use syntax;
 
-#[cfg(test)] use core::vec;
-
 pub struct Ctxt {
     ast: @ast::crate,
     ast_map: ast_map::map
index d6cae1f2fa3f56378d790c7a1df0a4a25f2863db..dc7621f98a09f1e5cd88ecab5852b11dbc06100e 100644 (file)
@@ -129,14 +129,12 @@ fn first_sentence_(s: &str) -> ~str {
         }
     });
     match idx {
-        Some(idx) if idx > 2u => {
-            str::to_owned(s.slice(0, idx - 1))
-        }
+        Some(idx) if idx > 2u => s.slice(0, idx - 1).to_owned(),
         _ => {
             if s.ends_with(".") {
-                str::to_owned(s)
+                s.to_owned()
             } else {
-                str::to_owned(s)
+                s.to_owned()
             }
         }
     }
index f4b6ae8fb32af8cd844246f20ded550e582d1323..f8c49f544bc2efb25e327680bb632ba7f210b183 100644 (file)
@@ -285,8 +285,6 @@ mod test {
     use extract::{extract, from_srv};
     use parse;
 
-    use core::vec;
-
     fn mk_doc(source: @str) -> doc::Doc {
         let ast = parse::from_str(source);
         extract(ast, ~"")
index 2e020cd9e5ada4961bfd834ff0161249a42a3d4d..36df3a5267d46ddcfc6451fe6662bb1118d1f660 100644 (file)
@@ -537,8 +537,6 @@ mod test {
     use tystr_pass;
     use unindent_pass;
 
-    use core::str;
-
     fn render(source: ~str) -> ~str {
         let (srv, doc) = create_doc_srv(source);
         let markdown = write_markdown_str_srv(srv, doc);
index bb5d71e8db1682ac870086a68127c7fde506e7ba..584e6ccc887301a3e2176cfbd0817ed170182965 100644 (file)
@@ -157,7 +157,6 @@ mod test {
     use doc;
     use extract;
     use page_pass::run;
-    use core::vec;
 
     fn mk_doc_(
         output_style: config::OutputStyle,
index 8a90d3f74d3907c4b1e16b8582dad94de1c0b8c4..484eb8c7980dc06bbff5b052edafa0295f523e80 100644 (file)
@@ -77,8 +77,6 @@ fn mk_doc(source: ~str) -> doc::Doc {
 
     #[test]
     fn should_prune_hidden_items() {
-        use core::vec;
-
         let doc = mk_doc(~"#[doc(hidden)] mod a { }");
         assert!(doc.cratemod().mods().is_empty())
     }
index e861939c2dde795483a9130f0ff8eb16b803d9c5..741da3e265eebb91e1c998317fb36d285cfba291 100644 (file)
@@ -162,7 +162,6 @@ mod test {
     use extract;
     use tystr_pass;
     use prune_private_pass::run;
-    use core::vec;
 
     fn mk_doc(source: ~str) -> doc::Doc {
         do astsrv::from_str(copy source) |srv| {
index c44be7f597ed32117467050a1dc1e7088bfe00fb..ba433bf479d2cebe5b5d0dde6c5dcffc838b65f6 100644 (file)
@@ -170,9 +170,6 @@ mod test {
     use extract;
     use sectionalize_pass::run;
 
-    use core::str;
-    use core::vec;
-
     fn mk_doc(source: ~str) -> doc::Doc {
         do astsrv::from_str(copy source) |srv| {
             let doc = extract::from_srv(srv.clone(), ~"");
index 400657d0c2559623670700e8ecb8ec9c7d0dde43..99a7a461ab24f3b43fd1ed336174bf91e3d60ce4 100644 (file)
@@ -515,7 +515,7 @@ fn with_filename(&self, f: &str) -> PosixPath {
     fn with_filestem(&self, s: &str) -> PosixPath {
         match self.filetype() {
             None => self.with_filename(s),
-            Some(ref t) => self.with_filename(str::to_owned(s) + *t),
+            Some(ref t) => self.with_filename(s.to_owned() + *t),
         }
     }
 
@@ -657,7 +657,7 @@ fn from_str(s: &str) -> WindowsPath {
             (None, None) => {
                 host = None;
                 device = None;
-                rest = str::to_owned(s);
+                rest = s.to_owned();
             }
         }
 
@@ -729,7 +729,7 @@ fn with_filename(&self, f: &str) -> WindowsPath {
     fn with_filestem(&self, s: &str) -> WindowsPath {
         match self.filetype() {
             None => self.with_filename(s),
-            Some(ref t) => self.with_filename(str::to_owned(s) + *t),
+            Some(ref t) => self.with_filename(s.to_owned() + *t),
         }
     }
 
@@ -984,7 +984,7 @@ fn test_filetype_foo() {
     fn test_posix_paths() {
         fn t(wp: &PosixPath, s: &str) {
             let ss = wp.to_str();
-            let sss = str::to_owned(s);
+            let sss = s.to_owned();
             if (ss != sss) {
                 debug!("got %s", ss);
                 debug!("expected %s", sss);
@@ -1042,7 +1042,7 @@ fn t(wp: &PosixPath, s: &str) {
     fn test_normalize() {
         fn t(wp: &PosixPath, s: &str) {
             let ss = wp.to_str();
-            let sss = str::to_owned(s);
+            let sss = s.to_owned();
             if (ss != sss) {
                 debug!("got %s", ss);
                 debug!("expected %s", sss);
@@ -1105,7 +1105,7 @@ fn test_extract_drive_prefixes() {
     fn test_windows_paths() {
         fn t(wp: &WindowsPath, s: &str) {
             let ss = wp.to_str();
-            let sss = str::to_owned(s);
+            let sss = s.to_owned();
             if (ss != sss) {
                 debug!("got %s", ss);
                 debug!("expected %s", sss);
index 89d497177dc431440c2322b29a8943c8a4598a51..1ab07003b6ea440df37a0c63f0997b450d0a904b 100644 (file)
@@ -1432,7 +1432,7 @@ fn trim_right(&self) -> &'self str {
      *
      * # Example
      *
-     * ~~~
+     * ~~~ {.rust}
      * assert_eq!("11foo1bar11".trim_chars(&'1'), "foo1bar")
      * assert_eq!("12foo1bar12".trim_chars(& &['1', '2']), "foo1bar")
      * assert_eq!("123foo1bar123".trim_chars(&|c: char| c.is_digit()), "foo1bar")
@@ -1451,7 +1451,7 @@ fn trim_chars<C: CharEq>(&self, to_trim: &C) -> &'self str {
      *
      * # Example
      *
-     * ~~~
+     * ~~~ {.rust}
      * assert_eq!("11foo1bar11".trim_left_chars(&'1'), "foo1bar11")
      * assert_eq!("12foo1bar12".trim_left_chars(& &['1', '2']), "foo1bar12")
      * assert_eq!("123foo1bar123".trim_left_chars(&|c: char| c.is_digit()), "foo1bar123")
@@ -1473,7 +1473,7 @@ fn trim_left_chars<C: CharEq>(&self, to_trim: &C) -> &'self str {
      *
      * # Example
      *
-     * ~~~
+     * ~~~ {.rust}
      * assert_eq!("11foo1bar11".trim_right_chars(&'1'), "11foo1bar")
      * assert_eq!("12foo1bar12".trim_right_chars(& &['1', '2']), "12foo1bar")
      * assert_eq!("123foo1bar123".trim_right_chars(&|c: char| c.is_digit()), "123foo1bar")