1
Fork 0

Switched over a bunch of splitting funktions to non-allocating iterators

This commit is contained in:
Marvin Löbel 2013-03-24 07:51:18 +01:00
parent d74606ead6
commit b9de2b5787
13 changed files with 135 additions and 98 deletions

View file

@ -806,7 +806,8 @@ impl serialize::Decoder for Decoder<'self> {
}
fn read_char(&self) -> char {
let v = str::chars(self.read_owned_str());
let mut v = ~[];
for str::each_char(self.read_owned_str()) |c| { v.push(c) }
if v.len() != 1 { fail!(~"string must have one character") }
v[0]
}