]> git.lizzy.rs Git - rust.git/commitdiff
Fix errors
authorAdolfo Ochagavía <aochagavia92@gmail.com>
Fri, 4 Jul 2014 20:38:13 +0000 (22:38 +0200)
committerAdolfo Ochagavía <aochagavia92@gmail.com>
Tue, 15 Jul 2014 18:34:16 +0000 (20:34 +0200)
22 files changed:
src/libcollections/str.rs
src/libcollections/string.rs
src/libregex/parse.rs
src/libregex/test/bench.rs
src/librustc/driver/mod.rs
src/librustc/metadata/encoder.rs
src/librustdoc/html/highlight.rs
src/librustdoc/html/render.rs
src/librustdoc/lib.rs
src/libstd/ascii.rs
src/libstd/fmt.rs
src/libstd/io/process.rs
src/libstd/os.rs
src/libstd/rt/backtrace.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/print/pprust.rs
src/libterm/terminfo/parser/compiled.rs
src/libterm/terminfo/searcher.rs
src/libtest/stats.rs
src/libtime/lib.rs
src/libuuid/lib.rs
src/test/run-pass/issue-3563-3.rs

index fb9e41f70bde2bf3cef121d2cdb25af8162bb01f..c2bde31b85981fac8987b2e115f7013c4196724f 100644 (file)
@@ -94,66 +94,26 @@ fn main() {
 Section: Creating a string
 */
 
-/// Consumes a vector of bytes to create a new utf-8 string.
-///
-/// Returns `Err` with the original vector if the vector contains invalid
-/// UTF-8.
-///
-/// # Example
-///
-/// ```rust
-/// use std::str;
-/// let hello_vec = vec![104, 101, 108, 108, 111];
-/// let string = str::from_utf8_owned(hello_vec);
-/// assert_eq!(string, Ok("hello".to_string()));
-/// ```
+/// Deprecated. Replaced by `String::from_utf8`
 #[deprecated = "Replaced by `String::from_utf8`"]
 pub fn from_utf8_owned(vv: Vec<u8>) -> Result<String, Vec<u8>> {
     String::from_utf8(vv)
 }
 
-/// Convert a byte to a UTF-8 string
-///
-/// # Failure
-///
-/// Fails if invalid UTF-8
-///
-/// # Example
-///
-/// ```rust
-/// use std::str;
-/// let string = str::from_byte(104);
-/// assert_eq!(string.as_slice(), "h");
-/// ```
+/// Deprecated. Replaced by `String::from_byte`
 #[deprecated = "Replaced by String::from_byte"]
 pub fn from_byte(b: u8) -> String {
     assert!(b < 128u8);
     String::from_char(1, b as char)
 }
 
-/// Convert a char to a string
-///
-/// # Example
-///
-/// ```rust
-/// use std::str;
-/// let string = str::from_char('b');
-/// assert_eq!(string.as_slice(), "b");
-/// ```
+/// Deprecated. Use `String::from_char` or `char::to_string()` instead
 #[deprecated = "use String::from_char or char.to_string()"]
 pub fn from_char(ch: char) -> String {
     String::from_char(1, ch)
 }
 
-/// Convert a vector of chars to a string
-///
-/// # Example
-///
-/// ```rust
-/// let chars = ['h', 'e', 'l', 'l', 'o'];
-/// let string = String::from_chars(chars);
-/// assert_eq!(string.as_slice(), "hello");
-/// ```
+/// Deprecated. Replaced by `String::from_chars`
 #[deprecated = "use String::from_chars instead"]
 pub fn from_chars(chs: &[char]) -> String {
     chs.iter().map(|c| *c).collect()
@@ -649,7 +609,6 @@ pub unsafe fn from_byte(u: u8) -> String {
     #[test]
     fn test_from_buf_len() {
         use slice::ImmutableVector;
-        use str::StrAllocating;
 
         unsafe {
             let a = vec![65u8, 65u8, 65u8, 65u8, 65u8, 65u8, 65u8, 0u8];
@@ -854,8 +813,7 @@ mod tests {
     use std::default::Default;
     use std::char::Char;
     use std::clone::Clone;
-    use std::cmp::{Equal, Greater, Less, Ord, Eq, PartialOrd, PartialEq, Equiv};
-    use std::result::{Ok, Err};
+    use std::cmp::{Equal, Greater, Less, Ord, PartialOrd, Equiv};
     use std::option::{Some, None};
     use std::ptr::RawPtr;
     use std::iter::{Iterator, DoubleEndedIterator};
@@ -1546,7 +1504,7 @@ fn test_char_at() {
         let mut pos = 0;
         for ch in v.iter() {
             assert!(s.char_at(pos) == *ch);
-            pos += from_char(*ch).len();
+            pos += String::from_char(1, *ch).len();
         }
     }
 
@@ -1557,7 +1515,7 @@ fn test_char_at_reverse() {
         let mut pos = s.len();
         for ch in v.iter().rev() {
             assert!(s.char_at_reverse(pos) == *ch);
-            pos -= from_char(*ch).len();
+            pos -= String::from_char(1, *ch).len();
         }
     }
 
@@ -1996,10 +1954,8 @@ fn test_into_maybe_owned() {
 mod bench {
     use test::Bencher;
     use super::*;
-    use vec::Vec;
     use std::iter::{Iterator, DoubleEndedIterator};
     use std::collections::Collection;
-    use std::slice::Vector;
 
     #[bench]
     fn char_iterator(b: &mut Bencher) {
index d5a666d4b4caa7d47d3adbb50ec98932d0b65552..5450f2d7c31a3778b63ca8947341e55f96f62311 100644 (file)
@@ -99,7 +99,7 @@ pub fn from_utf8(vec: Vec<u8>) -> Result<String, Vec<u8>> {
     ///
     /// ```rust
     /// let input = b"Hello \xF0\x90\x80World";
-    /// let output = std::str::from_utf8_lossy(input);
+    /// let output = String::from_utf8_lossy(input);
     /// assert_eq!(output.as_slice(), "Hello \uFFFDWorld");
     /// ```
     pub fn from_utf8_lossy<'a>(v: &'a [u8]) -> MaybeOwned<'a> {
@@ -218,18 +218,18 @@ macro_rules! error(() => ({
         Owned(res.into_string())
     }
 
-    /// Decode a UTF-16 encoded vector `v` into a string, returning `None`
+    /// Decode a UTF-16 encoded vector `v` into a `String`, returning `None`
     /// if `v` contains any invalid data.
     ///
     /// # Example
     ///
     /// ```rust
-    /// // ð\9d„žmusic
+    /// // 𝄞music
     /// let mut v = [0xD834, 0xDD1E, 0x006d, 0x0075,
     ///              0x0073, 0x0069, 0x0063];
-    /// assert_eq!(String::from_utf16(v), Some("ð\9d„žmusic".to_string()));
+    /// assert_eq!(String::from_utf16(v), Some("𝄞music".to_string()));
     ///
-    /// // ð\9d„žmu<invalid>ic
+    /// // 𝄞mu<invalid>ic
     /// v[4] = 0xD800;
     /// assert_eq!(String::from_utf16(v), None);
     /// ```
@@ -249,13 +249,13 @@ pub fn from_utf16(v: &[u16]) -> Option<String> {
     ///
     /// # Example
     /// ```rust
-    /// // ð\9d„žmus<invalid>ic<invalid>
+    /// // 𝄞mus<invalid>ic<invalid>
     /// let v = [0xD834, 0xDD1E, 0x006d, 0x0075,
     ///          0x0073, 0xDD1E, 0x0069, 0x0063,
     ///          0xD834];
     ///
     /// assert_eq!(String::from_utf16_lossy(v),
-    ///            "ð\9d„žmus\uFFFDic\uFFFD".to_string());
+    ///            "𝄞mus\uFFFDic\uFFFD".to_string());
     /// ```
     pub fn from_utf16_lossy(v: &[u16]) -> String {
         str::utf16_items(v).map(|c| c.to_char_lossy()).collect()
@@ -575,8 +575,9 @@ mod tests {
 
     use Mutable;
     use str;
-    use str::{Str, StrSlice, MaybeOwned, Owned, Slice};
+    use str::{Str, StrSlice, Owned, Slice};
     use super::String;
+    use vec::Vec;
 
     #[test]
     fn test_from_str() {
@@ -587,10 +588,10 @@ fn test_from_str() {
     #[test]
     fn test_from_utf8() {
         let xs = Vec::from_slice(b"hello");
-        assert_eq!(String::from_utf8(xs), Ok("hello".to_string()));
+        assert_eq!(String::from_utf8(xs), Ok(String::from_str("hello")));
 
-        let xs = Vec::from_slice("ศไทย中å\8dŽViệt Nam".as_bytes());
-        assert_eq!(String::from_utf8(xs), Ok("ศไทย中å\8dŽViệt Nam".to_string()));
+        let xs = Vec::from_slice("ศไทย中华Việt Nam".as_bytes());
+        assert_eq!(String::from_utf8(xs), Ok(String::from_str("ศไทย中华Việt Nam")));
 
         let xs = Vec::from_slice(b"hello\xFF");
         assert_eq!(String::from_utf8(xs),
@@ -602,21 +603,24 @@ fn test_from_utf8_lossy() {
         let xs = b"hello";
         assert_eq!(String::from_utf8_lossy(xs), Slice("hello"));
 
-        let xs = "ศไทย中å\8dŽViệt Nam".as_bytes();
-        assert_eq!(String::from_utf8_lossy(xs), Slice("ศไทย中å\8dŽViệt Nam"));
+        let xs = "ศไทย中华Việt Nam".as_bytes();
+        assert_eq!(String::from_utf8_lossy(xs), Slice("ศไทย中华Việt Nam"));
 
         let xs = b"Hello\xC2 There\xFF Goodbye";
-        assert_eq!(String::from_utf8_lossy(xs), Owned(String::from_str("Hello\uFFFD There\uFFFD Goodbye")));
+        assert_eq!(String::from_utf8_lossy(xs),
+                   Owned(String::from_str("Hello\uFFFD There\uFFFD Goodbye")));
 
         let xs = b"Hello\xC0\x80 There\xE6\x83 Goodbye";
         assert_eq!(String::from_utf8_lossy(xs),
                    Owned(String::from_str("Hello\uFFFD\uFFFD There\uFFFD Goodbye")));
 
         let xs = b"\xF5foo\xF5\x80bar";
-        assert_eq!(String::from_utf8_lossy(xs), Owned(String::from_str("\uFFFDfoo\uFFFD\uFFFDbar")));
+        assert_eq!(String::from_utf8_lossy(xs),
+                   Owned(String::from_str("\uFFFDfoo\uFFFD\uFFFDbar")));
 
         let xs = b"\xF1foo\xF1\x80bar\xF1\x80\x80baz";
-        assert_eq!(String::from_utf8_lossy(xs), Owned(String::from_str("\uFFFDfoo\uFFFDbar\uFFFDbaz")));
+        assert_eq!(String::from_utf8_lossy(xs),
+                   Owned(String::from_str("\uFFFDfoo\uFFFDbar\uFFFDbaz")));
 
         let xs = b"\xF4foo\xF4\x80bar\xF4\xBFbaz";
         assert_eq!(String::from_utf8_lossy(xs),
@@ -635,13 +639,13 @@ fn test_from_utf8_lossy() {
     #[test]
     fn test_from_utf16() {
         let pairs =
-            [(String::from_str("ðÂ\90Â\8dâ\80¦Ã°Â\90Å\92¿ðÂ\90Å\92»ðÂ\90Â\8dâ\80 Ã°Â\90Å\92¹ðÂ\90Å\92»ðÂ\90Å\92°\n"),
+            [(String::from_str("ð\90\8d\85ð\90\8c¿ð\90\8c»ð\90\8d\86ð\90\8c¹ð\90\8c»ð\90\8c°\n"),
               vec![0xd800_u16, 0xdf45_u16, 0xd800_u16, 0xdf3f_u16,
                 0xd800_u16, 0xdf3b_u16, 0xd800_u16, 0xdf46_u16,
                 0xd800_u16, 0xdf39_u16, 0xd800_u16, 0xdf3b_u16,
                 0xd800_u16, 0xdf30_u16, 0x000a_u16]),
 
-             (String::from_str("ðÂ\90Â\90â\80\99ðÂ\90â\80\98â\80°Ã°Â\90Â\90®ðÂ\90â\80\98â\82¬Ã°Â\90Â\90²ðÂ\90â\80\98â\80¹ Ã°Â\90Â\90Â\8fðÂ\90Â\90²ðÂ\90â\80\98Â\8d\n"),
+             (String::from_str("ð\90\90\92ð\90\91\89ð\90\90®ð\90\91\80ð\90\90²ð\90\91\8b ð\90\90\8fð\90\90²ð\90\91\8d\n"),
               vec![0xd801_u16, 0xdc12_u16, 0xd801_u16,
                 0xdc49_u16, 0xd801_u16, 0xdc2e_u16, 0xd801_u16,
                 0xdc40_u16, 0xd801_u16, 0xdc32_u16, 0xd801_u16,
@@ -649,7 +653,7 @@ fn test_from_utf16() {
                 0xd801_u16, 0xdc32_u16, 0xd801_u16, 0xdc4d_u16,
                 0x000a_u16]),
 
-             (String::from_str("ð\90Œ€ð\90Œ–ð\90Œ‹ð\90Œ„ð\90Œ‘ð\90Œ‰Â·ð\90ŒŒð\90Œ„ð\90Œ•ð\90Œ„ð\90Œ‹ð\90Œ‰ð\90Œ‘\n"),
+             (String::from_str("𐌀𐌖𐌋𐌄𐌑𐌉·𐌌𐌄𐌕𐌄𐌋𐌉𐌑\n"),
               vec![0xd800_u16, 0xdf00_u16, 0xd800_u16, 0xdf16_u16,
                 0xd800_u16, 0xdf0b_u16, 0xd800_u16, 0xdf04_u16,
                 0xd800_u16, 0xdf11_u16, 0xd800_u16, 0xdf09_u16,
@@ -658,7 +662,7 @@ fn test_from_utf16() {
                 0xdf04_u16, 0xd800_u16, 0xdf0b_u16, 0xd800_u16,
                 0xdf09_u16, 0xd800_u16, 0xdf11_u16, 0x000a_u16 ]),
 
-             (String::from_str("ð\90’‹ð\90’˜ð\90’ˆð\90’‘ð\90’›ð\90’’ ð\90’•ð\90’“ ð\90’ˆð\90’šð\90\8d ð\90\8fð\90’œð\90’’ð\90’–ð\90’† ð\90’•ð\90’†\n"),
+             (String::from_str("𐒋𐒘𐒈𐒑𐒛𐒒 𐒕𐒓 𐒈𐒚𐒍 𐒏𐒜𐒒𐒖𐒆 𐒕𐒆\n"),
               vec![0xd801_u16, 0xdc8b_u16, 0xd801_u16, 0xdc98_u16,
                 0xd801_u16, 0xdc88_u16, 0xd801_u16, 0xdc91_u16,
                 0xd801_u16, 0xdc9b_u16, 0xd801_u16, 0xdc92_u16,
@@ -718,7 +722,7 @@ fn test_from_utf16_lossy() {
 
         // general
         assert_eq!(String::from_utf16_lossy([0xD800, 0xd801, 0xdc8b, 0xD800]),
-                   String::from_str("\uFFFDð\90’‹\uFFFD"));
+                   String::from_str("\uFFFD𐒋\uFFFD"));
     }
 
     #[test]
@@ -852,7 +856,8 @@ fn from_utf8_lossy_100_ascii(b: &mut Bencher) {
 
     #[bench]
     fn from_utf8_lossy_100_multibyte(b: &mut Bencher) {
-        let s = "ð\90Œ€ð\90Œ–ð\90Œ‹ð\90Œ„ð\90Œ‘ð\90Œ‰à¸›à¸£Ø¯ÙˆÙ„Ø© Ø§Ù„كويتทศไทย中å\8dŽð\90\8d…ð\90Œ¿ð\90Œ»ð\90\8d†ð\90Œ¹ð\90Œ»ð\90Œ°".as_bytes();
+        let s = "ð\90Œ€ð\90Œ–ð\90Œ‹ð\90Œ„ð\90Œ‘ð\90Œ‰à¸›à¸£Ø¯ÙˆÙ„Ø©\
+            Ø§Ù„كويتทศไทย中å\8dŽð\90\8d…ð\90Œ¿ð\90Œ»ð\90\8d†ð\90Œ¹ð\90Œ»ð\90Œ°".as_bytes();
         assert_eq!(100, s.len());
         b.iter(|| {
             let _ = String::from_utf8_lossy(s);
index bc1e86449e09991adb0ca1583d6732beb54e542e..109d32f69b9678342caf8ea463325f0ad6d2b413 100644 (file)
@@ -13,7 +13,6 @@
 use std::fmt;
 use std::iter;
 use std::num;
-use std::str;
 
 /// Static data containing Unicode ranges for general categories and scripts.
 use unicode::regex::{UNICODE_CLASSES, PERLD, PERLS, PERLW};
index 98887e5357dfa9b529976cbf0b151530a809d3b6..2a606ccd0cee33c976585c75279e1c9bdaee627e 100644 (file)
@@ -10,7 +10,6 @@
 #![allow(non_snake_case_functions)]
 
 use std::rand::{Rng, task_rng};
-use std::str;
 use stdtest::Bencher;
 
 use regex::{Regex, NoExpand};
index 70dc6fac19bc7ad992a5a3c05e49e2f3f2faeaf3..3fd402c90fdd87a7d8e116c4e38ef585191fbaa7 100644 (file)
@@ -20,7 +20,6 @@
 use std::any::AnyRefExt;
 use std::io;
 use std::os;
-use std::str;
 use std::task::TaskBuilder;
 
 use syntax::ast;
index 85b5270e51bae76d83c4e3a4a52021a3d441e91d..87333499ec3a2f2a10b1a2ce32abd8b770a5b4cd 100644 (file)
@@ -35,7 +35,6 @@
 use std::hash;
 use std::io::MemWriter;
 use std::mem;
-use std::str;
 use std::collections::HashMap;
 use syntax::abi;
 use syntax::ast::*;
@@ -619,7 +618,7 @@ fn encode_visibility(ebml_w: &mut Encoder, visibility: Visibility) {
         Public => 'y',
         Inherited => 'i',
     };
-    ebml_w.wr_str(ch.to_str().as_slice());
+    ebml_w.wr_str(ch.to_string().as_slice());
     ebml_w.end_tag();
 }
 
@@ -1922,5 +1921,5 @@ pub fn encoded_ty(tcx: &ty::ctxt, t: ty::t) -> String {
         tcx: tcx,
         abbrevs: &RefCell::new(HashMap::new())
     }, t);
-    str::from_utf8(wr.get_ref()).unwrap().to_string()
+    String::from_utf8(wr.unwrap()).unwrap()
 }
index 5be0575532a3f025f274f90c0f7be09b9946209d..ecdc736790dbeb1a4f7a25ea9088a35b2fd28502 100644 (file)
@@ -13,7 +13,6 @@
 //! This module uses libsyntax's lexer to provide token-based highlighting for
 //! the HTML documentation generated by rustdoc.
 
-use std::str;
 use std::io;
 
 use syntax::parse;
index 2998e23bf5bb9c6b6bdff22dd7622787f942e1ca..244fada5b9adad07787661991342c9ff2d337020 100644 (file)
@@ -723,9 +723,9 @@ fn emit_source(&mut self, filename: &str) -> io::IoResult<()> {
 
         // Remove the utf-8 BOM if any
         let contents = if contents.starts_with("\ufeff") {
-            contents.as_slice().slice_from(3)
+            contents.slice_from(3)
         } else {
-            contents.as_slice()
+            contents
         };
 
         // Create the intermediate directories
index 04f0d4622d525f9e957d5a98532370280ff89479..2cbac090835edf95b730f2e353cbfc4d3008196c 100644 (file)
@@ -29,7 +29,6 @@
 
 use std::io;
 use std::io::{File, MemWriter};
-use std::str;
 use std::gc::Gc;
 use serialize::{json, Decodable, Encodable};
 use externalfiles::ExternalHtml;
index 23a7d45e9281167f16c44b5eb7ce58647c90433f..b9c86e2b23586b49b22ad845e677b90ba79002ea 100644 (file)
@@ -19,7 +19,6 @@
 use option::{Option, Some, None};
 use slice::{ImmutableVector, MutableVector, Vector};
 use str::{OwnedStr, Str, StrAllocating, StrSlice};
-use str;
 use string::String;
 use to_str::{IntoStr};
 use vec::Vec;
@@ -676,8 +675,8 @@ fn test_to_ascii_upper() {
         while i <= 500 {
             let upper = if 'a' as u32 <= i && i <= 'z' as u32 { i + 'A' as u32 - 'a' as u32 }
                         else { i };
-            assert_eq!((from_u32(i).unwrap()).to_str().as_slice().to_ascii_upper(),
-                       (from_u32(upper).unwrap()).to_str())
+            assert_eq!((from_u32(i).unwrap()).to_string().as_slice().to_ascii_upper(),
+                       (from_u32(upper).unwrap()).to_string())
             i += 1;
         }
     }
@@ -692,8 +691,8 @@ fn test_to_ascii_lower() {
         while i <= 500 {
             let lower = if 'A' as u32 <= i && i <= 'Z' as u32 { i + 'a' as u32 - 'A' as u32 }
                         else { i };
-            assert_eq!((from_u32(i).unwrap()).to_str().as_slice().to_ascii_lower(),
-                       (from_u32(lower).unwrap()).to_str())
+            assert_eq!((from_u32(i).unwrap()).to_string().as_slice().to_ascii_lower(),
+                       (from_u32(lower).unwrap()).to_string())
             i += 1;
         }
     }
@@ -708,8 +707,8 @@ fn test_into_ascii_upper() {
         while i <= 500 {
             let upper = if 'a' as u32 <= i && i <= 'z' as u32 { i + 'A' as u32 - 'a' as u32 }
                         else { i };
-            assert_eq!((from_u32(i).unwrap()).to_str().into_ascii_upper(),
-                       (from_u32(upper).unwrap()).to_str())
+            assert_eq!((from_u32(i).unwrap()).to_string().into_ascii_upper(),
+                       (from_u32(upper).unwrap()).to_string())
             i += 1;
         }
     }
@@ -725,8 +724,8 @@ fn test_into_ascii_lower() {
         while i <= 500 {
             let lower = if 'A' as u32 <= i && i <= 'Z' as u32 { i + 'a' as u32 - 'A' as u32 }
                         else { i };
-            assert_eq!((from_u32(i).unwrap()).to_str().into_ascii_lower(),
-                       (from_u32(lower).unwrap()).to_str())
+            assert_eq!((from_u32(i).unwrap()).to_string().into_ascii_lower(),
+                       (from_u32(lower).unwrap()).to_string())
             i += 1;
         }
     }
@@ -746,8 +745,8 @@ fn test_eq_ignore_ascii_case() {
             let c = i;
             let lower = if 'A' as u32 <= c && c <= 'Z' as u32 { c + 'a' as u32 - 'A' as u32 }
                         else { c };
-            assert!((from_u32(i).unwrap()).to_str().as_slice().eq_ignore_ascii_case(
-                    (from_u32(lower).unwrap()).to_str().as_slice()));
+            assert!((from_u32(i).unwrap()).to_string().as_slice().eq_ignore_ascii_case(
+                    (from_u32(lower).unwrap()).to_string().as_slice()));
             i += 1;
         }
     }
index aacf1232df52150c46b615bef99e9efbe82f84ad..b9c6220c0e2de8751a63880c332264a4e3a75981 100644 (file)
@@ -417,10 +417,7 @@ fn my_fmt_fn(args: &fmt::Arguments) {
 use io::Writer;
 use io;
 use result::{Ok, Err};
-use str::{Str, StrAllocating};
-use str;
 use string;
-use slice::Vector;
 
 pub use core::fmt::{Formatter, Result, FormatWriter, rt};
 pub use core::fmt::{Show, Bool, Char, Signed, Unsigned, Octal, Binary};
@@ -464,7 +461,7 @@ fn my_fmt_fn(args: &fmt::Arguments) {
 pub fn format(args: &Arguments) -> string::String{
     let mut output = io::MemWriter::new();
     let _ = write!(&mut output, "{}", args);
-    String::from_utf8(output.unwrap()).unwrap()
+    string::String::from_utf8(output.unwrap()).unwrap()
 }
 
 impl<'a> Writer for Formatter<'a> {
index 1f18200f5aad4ffbd11e5bab7ed1067de24d0135..1eee69834948fb24db130a6550d8f9acdef6d6a1 100644 (file)
@@ -14,7 +14,6 @@
 
 use prelude::*;
 
-use str;
 use fmt;
 use os;
 use io::{IoResult, IoError};
index 11b787f0b9acb76cce8613b6bc29e5fd8cf13167..96d3b3e3e6a5390fed602624e6ccbe32ce2aad12 100644 (file)
@@ -151,7 +151,6 @@ pub mod win32 {
     use slice::{MutableVector, ImmutableVector};
     use string::String;
     use str::StrSlice;
-    use str;
     use vec::Vec;
 
     pub fn fill_utf16_buf_and_decode(f: |*mut u16, DWORD| -> DWORD)
index fa9bf5d9bb693f2c291a09c3f44ee3251366ce2c..d01a1b5b1313ccba4d99abb6a816cec6d6194b68 100644 (file)
@@ -992,7 +992,6 @@ macro_rules! sym( ($e:expr, $t:ident) => (unsafe {
 mod test {
     use prelude::*;
     use io::MemWriter;
-    use str;
 
     macro_rules! t( ($a:expr, $b:expr) => ({
         let mut m = MemWriter::new();
index 244be0854bf704f832edaba35e89c3f470905495..703adcbd335521723e94eb5fd20202a86014b2ec 100644 (file)
@@ -22,7 +22,6 @@
 use std::gc::Gc;
 use std::io::File;
 use std::rc::Rc;
-use std::str;
 
 // These macros all relate to the file system; they either return
 // the column/row/filename of the expression, or they include
index c8e7806670e45c28f25978cd7e8718c249676f30..d524622f8ecf59ad9a36eb22badd0ff88f4dd504 100644 (file)
@@ -30,7 +30,6 @@
 use std::io::{IoResult, MemWriter};
 use std::io;
 use std::mem;
-use std::str;
 
 pub enum AnnNode<'a> {
     NodeBlock(&'a ast::Block),
index 09fe2ef29ef2c1d5a96fcef3ef4df3fb0e5c6331..94ed7fbbf306e02a71b54eb7a24de294eb7b669c 100644 (file)
@@ -14,7 +14,6 @@
 
 use std::collections::HashMap;
 use std::io;
-use std::str;
 use super::super::TermInfo;
 
 // These are the orders ncurses uses in its compiled format (as of 5.9). Not sure if portable.
index dff67fc32db7b66e81efc6824c08369a6126b552..7ad14d797549391cf69e8b554829a08a6c1fa8e5 100644 (file)
@@ -14,7 +14,7 @@
 
 use std::io::File;
 use std::os::getenv;
-use std::{os, str};
+use std::os;
 
 /// Return path to database entry for `term`
 pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> {
@@ -59,7 +59,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> {
     // Look for the terminal in all of the search directories
     for p in dirs_to_search.iter() {
         if p.exists() {
-            let f = first_char.to_str();
+            let f = first_char.to_string();
             let newp = p.join_many([f.as_slice(), term]);
             if newp.exists() {
                 return Some(box newp);
index ce2ba41d4761065dae00b6c9e8275deea5946304..51696521165325596e99ad4df8464255dc3699ba 100644 (file)
@@ -457,7 +457,6 @@ mod tests {
     use stats::write_5_number_summary;
     use stats::write_boxplot;
     use std::io;
-    use std::str;
     use std::f64;
 
     macro_rules! assert_approx_eq(
index 0690b561c44da7741b76e217ec41459b0f9138aa..41ba448754d08fd2efc491fcb41e2dcb1902472c 100644 (file)
@@ -31,7 +31,6 @@
 use std::io::BufReader;
 use std::num;
 use std::string::String;
-use std::str;
 
 static NSEC_PER_SEC: i32 = 1_000_000_000_i32;
 
index 1e9c58b66b75b2b32743def06a2516d064319d48..233743175b503f748a19c41251febe8dcf2e1474 100644 (file)
@@ -81,7 +81,6 @@ fn main() {
 use std::rand;
 use std::rand::Rng;
 use std::slice;
-use std::str;
 
 use serialize::{Encoder, Encodable, Decoder, Decodable};
 
index e2b7e6cbecdf940fe7421f7b5887b5a7498bc624..84f303de7057b43ffc1efff1e7a9cefb07206b9f 100644 (file)
@@ -20,7 +20,6 @@
 // Extern mod controls linkage. Use controls the visibility of names to modules that are
 // already linked in. Using WriterUtil allows us to use the write_line method.
 
-use std::str;
 use std::slice;
 use std::fmt;