Explorar el Código

Use proper split by whitespace

Frans Bergman hace 7 años
padre
commit
db1152c670
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/main.rs

+ 1 - 1
src/main.rs

@@ -67,7 +67,7 @@ pub fn main() {
                 }
 
                 // reply to a command if there was one
-                let mut split = message.content.split(' ');
+                let mut split = message.content.split_whitespace();
                 let first_word = split.next().unwrap_or("");
                 let argument = split.next().unwrap_or("");