diff options
author | Till Hoeppner | 2015-06-11 18:28:44 +0200 |
---|---|---|
committer | Till Hoeppner | 2015-06-11 18:28:44 +0200 |
commit | 27e53e57777fac2fe47f1a2610d0122dc60ed97d (patch) | |
tree | 323be044f3a14a8d98c56cb8683447e1ad1357e5 /src/format/weechat3.rs | |
parent | f67492f582215d177a7a5bb7c45c0f7e01628a7a (diff) | |
download | ilc-27e53e57777fac2fe47f1a2610d0122dc60ed97d.tar.gz ilc-27e53e57777fac2fe47f1a2610d0122dc60ed97d.tar.xz ilc-27e53e57777fac2fe47f1a2610d0122dc60ed97d.zip |
Adapt energymech to new Event API
Diffstat (limited to 'src/format/weechat3.rs')
-rw-r--r-- | src/format/weechat3.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/format/weechat3.rs b/src/format/weechat3.rs index 1534166..6ff5d5a 100644 --- a/src/format/weechat3.rs +++ b/src/format/weechat3.rs @@ -43,14 +43,14 @@ impl<'a, R: 'a> Iterator for Iter<'a, R> where R: BufRead { } loop { - let mut buffer = String::new(); - match self.input.read_line(&mut buffer) { + self.buffer.clear(); + match self.input.read_line(&mut self.buffer) { Ok(0) | Err(_) => return None, Ok(_) => () } let mut split_tokens: Vec<char> = Vec::new(); - let tokens = buffer.split(|c: char| { + let tokens = self.buffer.split(|c: char| { if c.is_whitespace() { split_tokens.push(c); true } else { false } }).collect::<Vec<_>>(); |