Browse Source

Command message now is stopped at newline

Lorenz 7 years ago
parent
commit
8a56642f36
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      hw9/task1/src/lib.rs

+ 2
- 2
hw9/task1/src/lib.rs View File

6
             let mut str = x.split_whitespace();
6
             let mut str = x.split_whitespace();
7
             match str.next() {
7
             match str.next() {
8
                 Some("STAGE") => {
8
                 Some("STAGE") => {
9
-                    let msg = m[6..].trim_left();
9
+                    let msg = x[6..].trim_left();
10
                     Ok(Command::Stage(msg.to_string()))
10
                     Ok(Command::Stage(msg.to_string()))
11
                 }
11
                 }
12
                 Some("CONTROL") => {
12
                 Some("CONTROL") => {
13
-                    let cmd = m[8..].trim_left();
13
+                    let cmd = x[8..].trim_left();
14
                     Ok(Command::Control(cmd.to_string()))
14
                     Ok(Command::Control(cmd.to_string()))
15
                 }
15
                 }
16
                 Some("RETRIEVE") => Ok(Command::Retrieve),
16
                 Some("RETRIEVE") => Ok(Command::Retrieve),

Loading…
Cancel
Save