summaryrefslogtreecommitdiff
path: root/rust/src/architecture.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/architecture.rs
parent52edc39a7081fd6662e14fbcd473adabbbc36c7a (diff)
Rust API: Lots and lots of clippy changes
Diffstat (limited to 'rust/src/architecture.rs')
-rw-r--r--rust/src/architecture.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs
index d5e1685f..348e8e06 100644
--- a/rust/src/architecture.rs
+++ b/rust/src/architecture.rs
@@ -108,12 +108,19 @@ impl InstructionInfo {
pub fn len(&self) -> usize {
self.0.length
}
+
+ pub fn is_empty(&self) -> bool {
+ self.0.length == 0
+ }
+
pub fn branch_count(&self) -> usize {
self.0.branchCount
}
+
pub fn branch_delay(&self) -> bool {
self.0.branchDelay
}
+
pub fn branches(&self) -> BranchIter {
BranchIter(self, 0..self.branch_count())
}
@@ -1363,7 +1370,7 @@ where
res.push(len as u32);
for i in items {
- res.push(i.clone().into());
+ res.push(i);
}
assert!(res.len() == len + 1);
@@ -1910,7 +1917,7 @@ where
let uninit_arch = ArchitectureBuilder {
arch: unsafe { zeroed() },
- func: func,
+ func,
};
let raw = Box::into_raw(Box::new(uninit_arch));