about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/io.rs b/src/libstd/io.rs
index 1db355dd385..ee03af79ab0 100644
--- a/src/libstd/io.rs
+++ b/src/libstd/io.rs
@@ -109,7 +109,7 @@ impl reader_util for reader {
             if ch == -1 || ch == 10 { break; }
             buf += [ch as u8];
         }
-        str::unsafe_from_bytes(buf)
+        str::from_bytes(buf)
     }
 
     fn read_c_str() -> str {
@@ -118,7 +118,7 @@ impl reader_util for reader {
             let ch = self.read_byte();
             if ch < 1 { break; } else { buf += [ch as u8]; }
         }
-        str::unsafe_from_bytes(buf)
+        str::from_bytes(buf)
     }
 
     // FIXME deal with eof?
@@ -479,7 +479,7 @@ fn seek_in_buf(offset: int, pos: uint, len: uint, whence: seek_style) ->
 
 fn read_whole_file_str(file: str) -> result::t<str, str> {
     result::chain(read_whole_file(file), { |bytes|
-        result::ok(str::unsafe_from_bytes(bytes))
+        result::ok(str::from_bytes(bytes))
     })
 }