summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-11-07 17:06:43 -0500
committerMason Reed <mason@vector35.com>2024-11-08 03:13:53 -0500
commit33eb8129f5f95f379bff6a5ba90b5a298c8318d6 (patch)
tree3dbfca210f865a678d19b9cfefe3367391d356d3 /plugins
parent4fd3930ba732637bec62fd7f88d713de5f9c2a84 (diff)
WARP: Misc clippy lints
Diffstat (limited to 'plugins')
-rw-r--r--plugins/warp/src/bin/sigem.rs2
-rw-r--r--plugins/warp/src/matcher.rs21
-rw-r--r--plugins/warp/src/plugin/find.rs2
3 files changed, 12 insertions, 13 deletions
diff --git a/plugins/warp/src/bin/sigem.rs b/plugins/warp/src/bin/sigem.rs
index 322096ee..63c9a677 100644
--- a/plugins/warp/src/bin/sigem.rs
+++ b/plugins/warp/src/bin/sigem.rs
@@ -96,7 +96,7 @@ fn data_from_view(view: &BinaryView) -> Data {
.collect::<Vec<_>>();
data.types.extend(view.types().iter().map(|ty| {
let ref_ty = ty.type_object().to_owned();
- ComputedType::new(from_bn_type(&view, &ref_ty, u8::MAX))
+ ComputedType::new(from_bn_type(view, &ref_ty, u8::MAX))
}));
data
}
diff --git a/plugins/warp/src/matcher.rs b/plugins/warp/src/matcher.rs
index 72751c4c..d5ecfbb7 100644
--- a/plugins/warp/src/matcher.rs
+++ b/plugins/warp/src/matcher.rs
@@ -1,5 +1,4 @@
use binaryninja::architecture::Architecture as BNArchitecture;
-use binaryninja::backgroundtask::BackgroundTask;
use binaryninja::binaryview::{BinaryView, BinaryViewExt};
use binaryninja::function::Function as BNFunction;
use binaryninja::platform::Platform;
@@ -82,13 +81,13 @@ impl Matcher {
}
pub fn from_data(data: Data) -> Self {
- let functions = data
- .functions
- .into_iter()
- .fold(DashMap::new(), |map, func| {
- map.entry(func.guid).or_insert_with(Vec::new).push(func);
+ let functions = data.functions.into_iter().fold(
+ DashMap::new(),
+ |map: DashMap<FunctionGUID, Vec<_>>, func| {
+ map.entry(func.guid).or_default().push(func);
map
- });
+ },
+ );
let types = data
.types
.iter()
@@ -109,9 +108,9 @@ impl Matcher {
}
pub fn extend_with_matcher(&mut self, matcher: Matcher) {
- self.functions.extend(matcher.functions.into_iter());
- self.types.extend(matcher.types.into_iter());
- self.named_types.extend(matcher.named_types.into_iter());
+ self.functions.extend(matcher.functions);
+ self.types.extend(matcher.types);
+ self.named_types.extend(matcher.named_types);
}
pub fn add_type_to_view<A: BNArchitecture>(&self, view: &BinaryView, arch: &A, ty: &Type) {
@@ -368,7 +367,7 @@ impl MatcherSettings {
);
}
- pub fn from_view(view: &BinaryView) -> Self {
+ pub fn from_view(_view: &BinaryView) -> Self {
let mut settings = MatcherSettings::default();
let bn_settings = binaryninja::settings::Settings::new("");
if bn_settings.contains(Self::TRIVIAL_FUNCTION_LEN_SETTING) {
diff --git a/plugins/warp/src/plugin/find.rs b/plugins/warp/src/plugin/find.rs
index 15a06add..f54b4a4c 100644
--- a/plugins/warp/src/plugin/find.rs
+++ b/plugins/warp/src/plugin/find.rs
@@ -36,7 +36,7 @@ impl Command for FindFunctionFromGUID {
let matched = funcs
.par_iter()
.filter(|func| {
- try_cached_function_guid(&func).is_some_and(|guid| guid == searched_guid)
+ try_cached_function_guid(func).is_some_and(|guid| guid == searched_guid)
})
.collect::<Vec<BNGuard<BNFunction>>>();