aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTill Hoeppner2015-07-26 15:53:18 +0200
committerTill Hoeppner2015-07-26 15:53:18 +0200
commitaa79405b22a06b1b97be17daa0a7d0b0456a693c (patch)
treee23bbb3806766c5558961db89fd5442e5a9ce016 /src
parent4ce03bf5f95c9b5099c890ac9de68596c5a3b1ff (diff)
downloadilc-aa79405b22a06b1b97be17daa0a7d0b0456a693c.tar.gz
ilc-aa79405b22a06b1b97be17daa0a7d0b0456a693c.tar.xz
ilc-aa79405b22a06b1b97be17daa0a7d0b0456a693c.zip
Alter name for better readability
Diffstat (limited to 'src')
-rw-r--r--src/freq.rs4
1 files changed, 2 insertions, 2 deletions
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;