From aa95934c312e6d3266b50244d1a53f4ce59fba8f Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 4 May 2024 13:45:18 +0300 Subject: [PATCH 1/2] fix clippy slow_vector_initialization Should be smaller codegen size --- src/dbghelp.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dbghelp.rs b/src/dbghelp.rs index 711b53db..a4729ad5 100644 --- a/src/dbghelp.rs +++ b/src/dbghelp.rs @@ -409,8 +409,7 @@ pub fn init() -> Result { // // See https://learn.microsoft.com/cpp/build/reference/pdbpath for an // example of where symbols are usually searched for. - let mut search_path_buf = Vec::new(); - search_path_buf.resize(1024, 0); + let mut search_path_buf = vec![0; 1024]; // Prefill the buffer with the current search path. if DBGHELP.SymGetSearchPathW().unwrap()( From d1192dfda01b34021a5034c160b12cd9516f1cc9 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sun, 8 Sep 2024 13:54:09 -0700 Subject: [PATCH 2/2] add import --- src/dbghelp.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dbghelp.rs b/src/dbghelp.rs index a4729ad5..192526f9 100644 --- a/src/dbghelp.rs +++ b/src/dbghelp.rs @@ -23,6 +23,7 @@ #![allow(non_snake_case)] +use alloc::vec; use alloc::vec::Vec; use super::windows::*;