mirror of
https://git.funtimes909.xyz/ServerSeekerV2/ServerSeekerV2.git
synced 2026-10-12 02:18:11 +08:00
Construct vec with capacity
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -56,7 +56,7 @@ pub async fn ping_server(host: &(String, u16)) -> Result<String, PingServerError
|
||||
return Err(PingServerError::MalformedResponse);
|
||||
}
|
||||
|
||||
let mut output = vec![];
|
||||
let mut output = Vec::with_capacity(bytes_needed);
|
||||
output.extend_from_slice(&buffer[..total_read]);
|
||||
let json = decode(&(buffer[(length + 1).into()..]));
|
||||
|
||||
|
||||
Reference in new issue
Block a user