Skip to content

Commit 57717fa

Browse files
committed
Replacing str::unsafe_from_bytes with str::from_bytes (part 5)
1 parent 87320a9 commit 57717fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstd/io.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl reader_util for reader {
109109
if ch == -1 || ch == 10 { break; }
110110
buf += [ch as u8];
111111
}
112-
str::unsafe_from_bytes(buf)
112+
str::from_bytes(buf)
113113
}
114114

115115
fn read_c_str() -> str {
@@ -118,7 +118,7 @@ impl reader_util for reader {
118118
let ch = self.read_byte();
119119
if ch < 1 { break; } else { buf += [ch as u8]; }
120120
}
121-
str::unsafe_from_bytes(buf)
121+
str::from_bytes(buf)
122122
}
123123

124124
// FIXME deal with eof?
@@ -479,7 +479,7 @@ fn seek_in_buf(offset: int, pos: uint, len: uint, whence: seek_style) ->
479479

480480
fn read_whole_file_str(file: str) -> result::t<str, str> {
481481
result::chain(read_whole_file(file), { |bytes|
482-
result::ok(str::unsafe_from_bytes(bytes))
482+
result::ok(str::from_bytes(bytes))
483483
})
484484
}
485485

0 commit comments

Comments
 (0)