From 2cf0b26dca1781ec4f0fa46d667edbbadbc4fe88 Mon Sep 17 00:00:00 2001 From: Aaron Weiss Date: Sun, 7 Feb 2016 11:33:45 -0500 Subject: [PATCH] Cleaned up new comments on source_nickname. --- src/client/data/message.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/data/message.rs b/src/client/data/message.rs index 452138e..075a277 100644 --- a/src/client/data/message.rs +++ b/src/client/data/message.rs @@ -38,10 +38,10 @@ impl Message { // ::= self.prefix.as_ref().and_then(|s| match (s.find('!'), s.find('@'), s.find('.')) { - (Some(i), _, _) => Some(&s[..i]), // nick!user - (None, Some(i), _) => Some(&s[..i]), // nick@host - (None, None, None) => Some(&s), // nick - _ => None // server.name + (Some(i), _, _) => Some(&s[..i]), // '!' [ '@' ] + (None, Some(i), _) => Some(&s[..i]), // '@' + (None, None, None) => Some(&s), // + _ => None // } ) } @@ -157,7 +157,7 @@ mod test { ).unwrap().source_nickname(), Some("test")); assert_eq!(Message::new( - Some("test!test@awe.did.you.know.irc.hostnames.have.dots"), "PING", vec![], Some("data") + Some("test!test@irc.test.com"), "PING", vec![], Some("data") ).unwrap().source_nickname(), Some("test")); assert_eq!(Message::new(