From 8bf21091210af570a74a29eb731a867c0788ebdb Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Thu, 16 Apr 2015 17:22:52 +0200 Subject: Only strip one parenthese from mask --- src/format/weechat3.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/format') 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 Iterator for Iter 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 { -- cgit v1.2.3