about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAdolfo OchagavĂ­a <aochagavia92@gmail.com>2014-07-10 17:43:03 +0200
committerAdolfo OchagavĂ­a <aochagavia92@gmail.com>2014-07-15 19:55:19 +0200
commit6ac4fc7fc2fb48599dbba55fcea5cfc1e6cd4602 (patch)
tree50f3c0ebee097596588282f1260bed2fdaa122fd /src/libstd
parent173baac495485848335cf5ffd52fcd4d061d6d50 (diff)
downloadrust-6ac4fc7fc2fb48599dbba55fcea5cfc1e6cd4602.tar.gz
rust-6ac4fc7fc2fb48599dbba55fcea5cfc1e6cd4602.zip
Deprecate `str::from_utf16`
Use `String::from_utf16` instead

[breaking-change]
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/os.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index 86577a9840d..a221dd5b376 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -137,7 +137,7 @@ pub fn getcwd() -> Path {
             fail!();
         }
     }
-    Path::new(str::from_utf16(str::truncate_utf16_at_nul(buf))
+    Path::new(String::from_utf16(str::truncate_utf16_at_nul(buf))
               .expect("GetCurrentDirectoryW returned invalid UTF-16"))
 }
 
@@ -180,7 +180,7 @@ pub mod win32 {
                     // We want to explicitly catch the case when the
                     // closure returned invalid UTF-16, rather than
                     // set `res` to None and continue.
-                    let s = str::from_utf16(sub)
+                    let s = String::from_utf16(sub)
                         .expect("fill_utf16_buf_and_decode: closure created invalid UTF-16");
                     res = option::Some(s)
                 }
@@ -1050,7 +1050,7 @@ pub fn error_string(errnum: uint) -> String {
                 return format!("OS Error {} (FormatMessageW() returned error {})", errnum, fm_err);
             }
 
-            let msg = str::from_utf16(str::truncate_utf16_at_nul(buf));
+            let msg = String::from_utf16(str::truncate_utf16_at_nul(buf));
             match msg {
                 Some(msg) => format!("OS Error {}: {}", errnum, msg),
                 None => format!("OS Error {} (FormatMessageW() returned invalid UTF-16)", errnum),
@@ -1207,7 +1207,7 @@ fn real_args() -> Vec<String> {
 
         // Push it onto the list.
         let opt_s = slice::raw::buf_as_slice(ptr as *const _, len, |buf| {
-            str::from_utf16(str::truncate_utf16_at_nul(buf))
+            String::from_utf16(str::truncate_utf16_at_nul(buf))
         });
         opt_s.expect("CommandLineToArgvW returned invalid UTF-16")
     });