diff options
| author | Kevin Cantu <me@kevincantu.org> | 2012-01-25 01:29:44 -0800 |
|---|---|---|
| committer | Kevin Cantu <me@kevincantu.org> | 2012-01-25 01:29:44 -0800 |
| commit | 57717fa4d8f27a05e16cbc4de0d55728aaf32e73 (patch) | |
| tree | 5be907f692ec55accbbeae9bcb074ceee282e6f7 /src/libstd | |
| parent | 87320a9f2768e5e011a6c8edaceb3d3b7ddc2747 (diff) | |
| download | rust-57717fa4d8f27a05e16cbc4de0d55728aaf32e73.tar.gz rust-57717fa4d8f27a05e16cbc4de0d55728aaf32e73.zip | |
Replacing str::unsafe_from_bytes with str::from_bytes (part 5)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io.rs | 6 |
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)) }) } |
