Skip to content

Commit ef53ce6

Browse files
committed
---
yaml --- r: 48097 b: refs/heads/incoming c: c33b4d9 h: refs/heads/master i: 48095: e79e589 v: v3
1 parent 178fedb commit ef53ce6

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
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 162c816e3434b9368313acc8ef000bad3ccbc218
9+
refs/heads/incoming: c33b4d98cca2eace9511b9ccfb072bc023b1697e
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/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>

branches/incoming/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)