summaryrefslogtreecommitdiff
path: root/rust/src/debuginfo.rs
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2023-01-05 17:29:14 -0500
committerKyleMiles <krm504@nyu.edu>2023-01-06 16:29:58 -0500
commita154e45cce79b0c2264c1e1cd37a3d1bf5bc6154 (patch)
tree11f436b720edfdf37819e9e83e7131d220687074 /rust/src/debuginfo.rs
parent52edc39a7081fd6662e14fbcd473adabbbc36c7a (diff)
Rust API: Lots and lots of clippy changes
Diffstat (limited to 'rust/src/debuginfo.rs')
-rw-r--r--rust/src/debuginfo.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/rust/src/debuginfo.rs b/rust/src/debuginfo.rs
index 766ed026..32b478fb 100644
--- a/rust/src/debuginfo.rs
+++ b/rust/src/debuginfo.rs
@@ -172,7 +172,7 @@ impl DebugInfoParser {
if info.is_null() {
return None;
}
- return Some(unsafe { DebugInfo::from_raw(info) });
+ Some(unsafe { DebugInfo::from_raw(info) })
}
// Registers a DebugInfoParser. See `binaryninja::debuginfo::DebugInfoParser` for more details.
@@ -576,11 +576,11 @@ impl DebugInfo {
unsafe { slice::from_raw_parts(raw_names_and_types as *mut _, count) };
let mut result = Vec::with_capacity(count);
- for i in 0..count {
+ for name_and_type in names_and_types.iter().take(count) {
unsafe {
result.push((
- raw_to_string((*names_and_types[i]).name).unwrap(),
- Type::ref_from_raw(BNNewTypeReference((*names_and_types[i]).type_)),
+ raw_to_string((**name_and_type).name).unwrap(),
+ Type::ref_from_raw(BNNewTypeReference((**name_and_type).type_)),
))
};
}
@@ -605,12 +605,12 @@ impl DebugInfo {
unsafe { slice::from_raw_parts(raw_variables_and_names as *mut _, count) };
let mut result = Vec::with_capacity(count);
- for i in 0..count {
+ for variable_and_name in variables_and_names.iter().take(count) {
unsafe {
result.push((
- raw_to_string((*variables_and_names[i]).name).unwrap(),
- (*variables_and_names[i]).address,
- Type::ref_from_raw(BNNewTypeReference((*variables_and_names[i]).type_)),
+ raw_to_string((**variable_and_name).name).unwrap(),
+ (**variable_and_name).address,
+ Type::ref_from_raw(BNNewTypeReference((**variable_and_name).type_)),
))
};
}
@@ -629,12 +629,12 @@ impl DebugInfo {
unsafe { slice::from_raw_parts(raw_variables_and_names as *mut _, count) };
let mut result = Vec::with_capacity(count);
- for i in 0..count {
+ for variable_and_name in variables_and_names.iter().take(count) {
unsafe {
result.push((
- raw_to_string((*variables_and_names[i]).parser).unwrap(),
- raw_to_string((*variables_and_names[i]).name).unwrap(),
- Type::ref_from_raw(BNNewTypeReference((*variables_and_names[i]).type_)),
+ raw_to_string((**variable_and_name).parser).unwrap(),
+ raw_to_string((**variable_and_name).name).unwrap(),
+ Type::ref_from_raw(BNNewTypeReference((**variable_and_name).type_)),
))
};
}