Skip to content

Commit 9e3c962

Browse files
committed
---
yaml --- r: 44905 b: refs/heads/master c: c33b4d9 h: refs/heads/master i: 44903: 1927b58 v: v3
1 parent 32e0ea8 commit 9e3c962

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
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: 162c816e3434b9368313acc8ef000bad3ccbc218
2+
refs/heads/master: c33b4d98cca2eace9511b9ccfb072bc023b1697e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/etc/kate/rust.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
<item> drop </item>
1919
<item> else </item>
2020
<item> enum </item>
21-
<item> export </item>
2221
<item> extern </item>
23-
<item> fail </item>
2422
<item> for </item>
2523
<item> if </item>
2624
<item> impl </item>
@@ -29,7 +27,6 @@
2927
<item> loop </item>
3028
<item> match </item>
3129
<item> mod </item>
32-
<item> move </item>
3330
<item> mut </item>
3431
<item> priv </item>
3532
<item> pub </item>

trunk/src/libcore/io.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ pub trait ReaderUtil {
7878
/// Read len bytes into a new vec.
7979
fn read_bytes(&self, len: uint) -> ~[u8];
8080

81-
/// Read up until a specified character (which is not returned) or EOF.
82-
fn read_until(&self, c: char) -> ~str;
83-
8481
/// Read up until the first '\n' char (which is not returned), or EOF.
8582
fn read_line(&self) -> ~str;
8683

@@ -184,22 +181,16 @@ impl<T:Reader> ReaderUtil for T {
184181
bytes
185182
}
186183

187-
fn read_until(&self, c: char) -> ~str {
184+
fn read_line(&self) -> ~str {
188185
let mut bytes = ~[];
189186
loop {
190187
let ch = self.read_byte();
191-
if ch == -1 || ch == c as int {
192-
break;
193-
}
188+
if ch == -1 || ch == 10 { break; }
194189
bytes.push(ch as u8);
195190
}
196191
str::from_bytes(bytes)
197192
}
198193

199-
fn read_line(&self) -> ~str {
200-
self.read_until('\n')
201-
}
202-
203194
fn read_chars(&self, n: uint) -> ~[char] {
204195
// returns the (consumed offset, n_req), appends characters to &chars
205196
fn chars_from_bytes<T:Reader>(bytes: &~[u8], chars: &mut ~[char])
@@ -271,7 +262,12 @@ impl<T:Reader> ReaderUtil for T {
271262
}
272263

273264
fn read_c_str(&self) -> ~str {
274-
self.read_until(0 as char)
265+
let mut bytes: ~[u8] = ~[];
266+
loop {
267+
let ch = self.read_byte();
268+
if ch < 1 { break; } else { bytes.push(ch as u8); }
269+
}
270+
str::from_bytes(bytes)
275271
}
276272

277273
fn read_whole_stream(&self) -> ~[u8] {

0 commit comments

Comments
 (0)