Correction : ne plus déclarer à chaque fois le vecteur qui reçoit la
commande parsée
This commit is contained in:
parent
4a4dd5817b
commit
5cd4fc2632
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ fn main() {
|
|||
let mut buffer = String::new();
|
||||
let mut result_bytes_read: io::Result<usize>;
|
||||
let mut bytes_read: usize = 1;
|
||||
let mut command_vec: Vec<String>;
|
||||
|
||||
while bytes_read != 0 {
|
||||
buffer.clear();
|
||||
|
@ -23,7 +24,7 @@ fn main() {
|
|||
} else {
|
||||
bytes_read = result_bytes_read.unwrap();
|
||||
if bytes_read != 0 {
|
||||
let command_vec: Vec<String> = parser::parse(&buffer);
|
||||
command_vec = parser::parse(&buffer);
|
||||
println!("{:?}", command_vec);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue