aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTill Hoeppner2015-04-16 17:22:52 +0200
committerTill Hoeppner2015-04-16 17:22:52 +0200
commit8bf21091210af570a74a29eb731a867c0788ebdb (patch)
treed4bdd33ca5e0a46c81e3cb4d53dac2a0711301df /src
parent7a53dc9193c8afa9e6e8c03f233d4b0b5a745d19 (diff)
downloadilc-8bf21091210af570a74a29eb731a867c0788ebdb.tar.gz
ilc-8bf21091210af570a74a29eb731a867c0788ebdb.tar.xz
ilc-8bf21091210af570a74a29eb731a867c0788ebdb.zip
Only strip one parenthese from mask
Diffstat (limited to 'src')
-rw-r--r--src/format/weechat3.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/format/weechat3.rs b/src/format/weechat3.rs
index e7d8360..0904ced 100644
--- a/src/format/weechat3.rs
+++ b/src/format/weechat3.rs
@@ -1,6 +1,6 @@
use std::io::{ self, BufRead, Write };
use std::borrow::ToOwned;
-use std::iter::{ Iterator, AdditiveIterator };
+use std::iter::{ Iterator };
use log::Event;
use format::{ Encode, Decode };
@@ -31,7 +31,7 @@ impl<R> Iterator for Iter<R> where R: BufRead {
out.pop(); out
}
fn mask(s: &str) -> String {
- s.trim_left_matches('(').trim_right_matches(')').to_owned()
+ if s.len() >= 2 { s[1..(s.len() - 1)].to_owned() } else { String::new() }
}
loop {