Skip to content

Commit 17a89de

Browse files
committed
---
yaml --- r: 12895 b: refs/heads/master c: 9d01c46 h: refs/heads/master i: 12893: 17e246a 12891: 66eee73 12887: cd9cf42 12879: 339aef4 12863: 8bda0cc v: v3
1 parent 5367140 commit 17a89de

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e7ca3e4db02d7d87dd7a2172394e08fbb92b8fb2
2+
refs/heads/master: 9d01c46c07c2418ae5c26f03785c350185b17ed0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/io.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,24 @@ impl reader_util for reader {
161161
while !self.eof() { buf += self.read_bytes(2048u); }
162162
buf
163163
}
164+
165+
fn each_byte(it: fn(int) -> bool) {
166+
while !self.eof() {
167+
if !it(self.read_byte()) { break; }
168+
}
169+
}
170+
171+
fn each_char(it: fn(char) -> bool) {
172+
while !self.eof() {
173+
if !it(self.read_char()) { break; }
174+
}
175+
}
176+
177+
fn each_line(it: fn(str) -> bool) {
178+
while !self.eof() {
179+
if !it(self.read_line()) { break; }
180+
}
181+
}
164182
}
165183

166184
// Reader implementations

0 commit comments

Comments
 (0)