summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-10-19 21:05:08 -0400
committerMason Reed <mason@vector35.com>2024-10-19 21:05:08 -0400
commit47fb9dbf43fb069635d421dabd16f7a721ec1d9a (patch)
tree1e1c774f9e1ac358f32a42b9e395a6f77def3d64 /rust
parentb42157dd6b361bf9ab38fc7b010870a1d143ba46 (diff)
Fix some rust warnings and remove mention of `binja-rs`
Diffstat (limited to 'rust')
-rw-r--r--rust/examples/dwarf/dwarf_import/src/lib.rs2
-rw-r--r--rust/examples/workflow/src/lib.rs5
-rw-r--r--rust/src/rc.rs2
-rw-r--r--rust/src/workflow.rs2
4 files changed, 6 insertions, 5 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs
index e5508b40..b04c04db 100644
--- a/rust/examples/dwarf/dwarf_import/src/lib.rs
+++ b/rust/examples/dwarf/dwarf_import/src/lib.rs
@@ -91,7 +91,7 @@ fn calculate_total_unit_bytes<R: ReaderType>(
{
let mut iter = dwarf.units();
let mut total_size: usize = 0;
- while let (Ok(Some(header))) = iter.next()
+ while let Ok(Some(header)) = iter.next()
{
total_size += header.length_including_self();
}
diff --git a/rust/examples/workflow/src/lib.rs b/rust/examples/workflow/src/lib.rs
index 0392b3bf..3e295c51 100644
--- a/rust/examples/workflow/src/lib.rs
+++ b/rust/examples/workflow/src/lib.rs
@@ -1,6 +1,5 @@
-use binaryninja::architecture::CoreArchitecture;
use binaryninja::llil::{
- ExprInfo, LiftedNonSSA, Mutable, NonSSA, RegularNonSSA, VisitorAction, SSA,
+ ExprInfo, LiftedNonSSA, NonSSA, VisitorAction,
};
use binaryninja::workflow::{Activity, AnalysisContext, Workflow};
use log::LevelFilter;
@@ -32,7 +31,7 @@ fn example_activity(analysis_context: &AnalysisContext) {
if let Some(llil_instr) = llil.instruction_at(instr) {
llil_instr.visit_tree(&mut |expr, info| {
match info {
- ExprInfo::Const(op) => {
+ ExprInfo::Const(_op) => {
// Replace all consts with 0x1337.
log::info!(
"Replacing llil expression @ 0x{:x} : {}",
diff --git a/rust/src/rc.rs b/rust/src/rc.rs
index dc1a502b..342633b9 100644
--- a/rust/src/rc.rs
+++ b/rust/src/rc.rs
@@ -134,7 +134,7 @@ impl<T: RefCountable + Hash> Hash for Ref<T> {
// reference is held indirectly (e.g. a core-allocated array
// of raw `*mut BNRawT`).
//
-// This wrapper is necessary because `binja-rs` wrappers around
+// This wrapper is necessary because rust wrappers around
// core objects can be bigger than the raw pointer to the core
// object. This lets us create the full wrapper object and ensure
// that it does not outlive the core-allocated array (or similar)
diff --git a/rust/src/workflow.rs b/rust/src/workflow.rs
index ae5c8e65..7172e779 100644
--- a/rust/src/workflow.rs
+++ b/rust/src/workflow.rs
@@ -24,6 +24,7 @@ impl AnalysisContext {
Self { handle }
}
+ #[allow(unused)]
pub(crate) unsafe fn ref_from_raw(handle: NonNull<BNAnalysisContext>) -> Ref<Self> {
Ref::new(Self { handle })
}
@@ -156,6 +157,7 @@ impl Activity {
Self { handle }
}
+ #[allow(unused)]
pub(crate) unsafe fn ref_from_raw(handle: NonNull<BNActivity>) -> Ref<Self> {
Ref::new(Self { handle })
}