Correction : ne plus déclarer à chaque fois le vecteur qui reçoit la

commande parsée
This commit is contained in:
Hippolyte Chauvin 2023-10-29 19:34:55 +01:00
parent 4a4dd5817b
commit 5cd4fc2632

View file

@ -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);
}
}