From 57717fa4d8f27a05e16cbc4de0d55728aaf32e73 Mon Sep 17 00:00:00 2001 From: Kevin Cantu Date: Wed, 25 Jan 2012 01:29:44 -0800 Subject: Replacing str::unsafe_from_bytes with str::from_bytes (part 5) --- src/libstd/io.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstd') 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 { result::chain(read_whole_file(file), { |bytes| - result::ok(str::unsafe_from_bytes(bytes)) + result::ok(str::from_bytes(bytes)) }) } -- cgit 1.4.1-3-g733a5