From 4d7c2065e98c80cb8e85a9a5847c16f70acc0610 Mon Sep 17 00:00:00 2001 From: Aaron Weiss Date: Mon, 3 Nov 2014 01:47:36 -0500 Subject: [PATCH] Added FIXME to from_message(...) with details on how to rewrite it. --- src/data/command.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/data/command.rs b/src/data/command.rs index 1fee292..071a36c 100644 --- a/src/data/command.rs +++ b/src/data/command.rs @@ -229,6 +229,20 @@ impl<'a> Command<'a> { /// Converts a Message into a Command #[stable] pub fn from_message(m: &'a Message) -> IoResult> { + /* FIXME: Re-write this using match as so: + if let "PASS" = m.command[] { + match m.suffix { + Some(ref suffix) => { + if m.args.len() != 0 { return Err(invalid_input()) } + PASS(suffix[]) + }, + None => { + if m.args.len() != 1 { return Err(invalid_input()) } + PASS(m.args[0][]) + } + } + } + */ Ok(if let "PASS" = m.command[] { if m.suffix.is_some() { if m.args.len() != 0 { return Err(invalid_input()) }