summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Müller <neikos@neikos.email>2023-01-03 09:53:32 +0100
committerMarcel Müller <neikos@neikos.email>2023-01-04 08:38:40 +0100
commit1b3e85d4443c80639cd40e2c382877b5077fe929 (patch)
tree8d62af75021d76804e08502f6401ca413d4c483b
parent5abe42497e61015b4eb26298ed2e864aaf18ce73 (diff)
Actually create vec with the given size
Signed-off-by: Marcel Müller <neikos@neikos.email>
-rw-r--r--mqtt-tester/src/command.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/mqtt-tester/src/command.rs b/mqtt-tester/src/command.rs
index e63c7f2..56096b3 100644
--- a/mqtt-tester/src/command.rs
+++ b/mqtt-tester/src/command.rs
@@ -41,7 +41,7 @@ impl Command {
to_client.write_all(&bytes).await.into_diagnostic()?
}
ClientCommand::WaitFor(expected_bytes) => {
- let mut buf = Vec::with_capacity(expected_bytes.len());
+ let mut buf = vec![0; expected_bytes.len()];
match tokio::time::timeout(
std::time::Duration::from_millis(100),
from_client.read_exact(&mut buf),