Skip to content

Commit

Permalink
tool: use Vec::with_capacity constructor
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Velickovic <[email protected]>
Signed-off-by: James Archer <[email protected]>
  • Loading branch information
JE-Archer and Ivan-Velickovic authored Sep 9, 2024
1 parent 61af145 commit edf9ce6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tool/microkit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3404,8 +3404,7 @@ fn main() -> Result<(), String> {
&(schedule.len() as u64).to_le_bytes(),
)?;

let mut out = Vec::new();
out.reserve_exact(schedule.len() * 16);
let mut out = Vec::with_capacity(schedule.len() * 16);

for timeslice in schedule.iter() {
out.extend(timeslice.id.to_le_bytes());
Expand Down

0 comments on commit edf9ce6

Please sign in to comment.