From a154e45cce79b0c2264c1e1cd37a3d1bf5bc6154 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 5 Jan 2023 17:29:14 -0500 Subject: Rust API: Lots and lots of clippy changes --- rust/src/architecture.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'rust/src/architecture.rs') 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)); -- cgit v1.3.1