We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ecdf3a commit d38939cCopy full SHA for d38939c
src/libcore/io.rs
@@ -185,13 +185,13 @@ impl<T: Reader> T : ReaderUtil {
185
}
186
187
fn read_line(&self) -> ~str {
188
- let mut bytes = ~[];
+ let mut line = ~"";
189
loop {
190
let ch = self.read_byte();
191
if ch == -1 || ch == 10 { break; }
192
- bytes.push(ch as u8);
+ str::push_char(&mut line, ch as char);
193
194
- str::from_bytes(bytes)
+ line
195
196
197
fn read_chars(&self, n: uint) -> ~[char] {
0 commit comments