Use Vec::with_capacity (#891)

Co-authored-by: Matthew Martin <phy1729@Matthews-Mac-mini.local>
This commit is contained in:
Matthew Martin
2026-02-17 11:55:34 -06:00
committed by GitHub
parent 9b6c4cee0b
commit 062db87572
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ impl GenericFramebuffer for Framebuffer {
rop: 0,
};
let mut raw_buffer = Vec::new();
let mut raw_buffer = Vec::with_capacity(buffer.len() * 2);
for (r, g, b) in buffer {
let mut rgb565: u16 = (r as u16 & 0b11111000) << 8;
rgb565 |= (g as u16 & 0b11111100) << 3;