From aa79405b22a06b1b97be17daa0a7d0b0456a693c Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Sun, 26 Jul 2015 15:53:18 +0200 Subject: Alter name for better readability --- src/freq.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/freq.rs b/src/freq.rs index 39015ee..792f620 100644 --- a/src/freq.rs +++ b/src/freq.rs @@ -34,7 +34,7 @@ fn words(s: &str) -> u32 { s.split_whitespace().filter(|s| !s.is_empty()).count() as u32 } -fn strip_nick(s: &str) -> &str { +fn strip_nick_prefix(s: &str) -> &str { if s.is_empty() { return s } match s.as_bytes()[0] { b'~' | b'&' | b'@' | b'%' | b'+' => &s[1..], @@ -61,7 +61,7 @@ fn main() { match m { Event { ty: Type::Msg { ref from, ref content, .. }, .. } => { - let nick = strip_nick(from); + let nick = strip_nick_prefix(from); if stats.contains_key(nick) { let p: &mut Person = stats.get_mut(nick).unwrap(); p.lines += 1; -- cgit v1.2.3