|
|
@@ -1,5 +1,5 @@
|
|
1
|
1
|
pub fn parse(message: &str) -> Command {
|
|
2
|
|
- let m : String = String::from(message);
|
|
|
2
|
+ let m: String = String::from(message);
|
|
3
|
3
|
let mut line = m.lines();
|
|
4
|
4
|
match line.next() {
|
|
5
|
5
|
Some(x) => {
|
|
|
@@ -13,12 +13,12 @@ pub fn parse(message: &str) -> Command {
|
|
13
|
13
|
let cmd = m[8..].trim_left();
|
|
14
|
14
|
Command::Control(cmd.to_string())
|
|
15
|
15
|
}
|
|
16
|
|
- Some("RETRIEVE") => { Command::Retrieve }
|
|
17
|
|
- Some(_) => { Command::Error(ParseError::UnknownCommand) }
|
|
18
|
|
- None => { Command::Error(ParseError::EmptyString) }
|
|
|
16
|
+ Some("RETRIEVE") => Command::Retrieve,
|
|
|
17
|
+ Some(_) => Command::Error(ParseError::UnknownCommand),
|
|
|
18
|
+ None => Command::Error(ParseError::EmptyString),
|
|
19
|
19
|
}
|
|
20
|
20
|
}
|
|
21
|
|
- None => { Command::Error(ParseError::EmptyString) }
|
|
|
21
|
+ None => Command::Error(ParseError::EmptyString),
|
|
22
|
22
|
}
|
|
23
|
23
|
}
|
|
24
|
24
|
|