From 6546844ca4274cd11ec2c91da7c6d7b5e8a82d0b Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Thu, 4 Dec 2025 15:10:40 -0500 Subject: [Rust] Fix misc clippy lints and warnings These are introduced after changing to Rust 1.91.1 --- plugins/idb_import/src/types.rs | 2 +- plugins/warp/src/cache/type_reference.rs | 2 +- plugins/warp/src/convert/types.rs | 2 +- plugins/warp/src/lib.rs | 2 +- plugins/warp/src/plugin.rs | 4 +++- 5 files changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/idb_import/src/types.rs b/plugins/idb_import/src/types.rs index 77c089e9..933fec12 100644 --- a/plugins/idb_import/src/types.rs +++ b/plugins/idb_import/src/types.rs @@ -630,7 +630,7 @@ pub fn translate_til_types( arch: CoreArchitecture, til: &TILSection, progress: impl Fn(usize, usize) -> Result<(), ()>, -) -> Result> { +) -> Result>> { let total = til.symbols.len() + til.types.len(); let mut types = Vec::with_capacity(total); let mut types_by_ord = HashMap::with_capacity(total); diff --git a/plugins/warp/src/cache/type_reference.rs b/plugins/warp/src/cache/type_reference.rs index 0b07c139..2c59c2fb 100644 --- a/plugins/warp/src/cache/type_reference.rs +++ b/plugins/warp/src/cache/type_reference.rs @@ -39,7 +39,7 @@ pub fn cached_type_reference( } } -pub fn cached_type_references(view: &BinaryView) -> Option> { +pub fn cached_type_references(view: &BinaryView) -> Option> { let view_id = ViewID::from(view); let type_ref_cache = TYPE_REF_CACHE.get_or_init(Default::default); type_ref_cache.get(&view_id) diff --git a/plugins/warp/src/convert/types.rs b/plugins/warp/src/convert/types.rs index 2401a039..f8ead6af 100644 --- a/plugins/warp/src/convert/types.rs +++ b/plugins/warp/src/convert/types.rs @@ -281,7 +281,7 @@ pub fn to_bn_calling_convention( // Always pass the architecture unless you know what you're doing! pub fn to_bn_type(arch: Option, ty: &Type) -> BNRef { - let bits_to_bytes = |val: u64| (val / 8); + let bits_to_bytes = |val: u64| val / 8; let addr_size = arch.map(|a| a.address_size()).unwrap_or(8) as u64; match &ty.class { TypeClass::Void => BNType::void(), diff --git a/plugins/warp/src/lib.rs b/plugins/warp/src/lib.rs index 9f40acef..1e622d58 100644 --- a/plugins/warp/src/lib.rs +++ b/plugins/warp/src/lib.rs @@ -254,7 +254,7 @@ pub fn basic_block_guid( pub fn filtered_instructions_at( il: &LowLevelILFunction, addr: u64, -) -> Vec> { +) -> Vec> { il.instructions_at(addr) .into_iter() .enumerate() diff --git a/plugins/warp/src/plugin.rs b/plugins/warp/src/plugin.rs index f384a6f5..9fe6cd3f 100644 --- a/plugins/warp/src/plugin.rs +++ b/plugins/warp/src/plugin.rs @@ -19,7 +19,6 @@ use log::LevelFilter; mod commit; mod create; -mod debug; mod ffi; mod file; mod function; @@ -29,6 +28,9 @@ mod render_layer; mod settings; mod workflow; +#[cfg(debug_assertions)] +mod debug; + fn load_bundled_signatures() { let global_bn_settings = Settings::new(); let plugin_settings = -- cgit v1.3.1