Quellcode durchsuchen

Command message now is stopped at newline

Lorenz vor 7 Jahren
Ursprung
Commit
8a56642f36
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2
    2
      hw9/task1/src/lib.rs

+ 2
- 2
hw9/task1/src/lib.rs Datei anzeigen

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

Laden…
Abbrechen
Speichern