Skip to content

Commit 4aef4eb

Browse files
author
etke
committed
Fix clippy warnings
1 parent 60e45c9 commit 4aef4eb

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

src/binary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use checksec::macho;
1010
#[cfg(feature = "pe")]
1111
use checksec::pe;
1212

13-
#[derive(Debug, Deserialize, PartialEq, Serialize)]
13+
#[derive(Debug, Deserialize, Eq, PartialEq, Serialize)]
1414
pub enum BinType {
1515
#[cfg(feature = "elf")]
1616
Elf32,
@@ -75,7 +75,7 @@ pub enum BinSpecificProperties {
7575
}
7676
impl fmt::Display for BinSpecificProperties {
7777
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
78-
match &*self {
78+
match self {
7979
#[cfg(feature = "elf")]
8080
Self::Elf(b) => write!(f, "{}", b),
8181
#[cfg(feature = "pe")]

src/elf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::colorize_bool;
1515
use crate::shared::{Rpath, VecRpath};
1616

1717
/// Relocation Read-Only mode: `None`, `Partial`, or `Full`
18-
#[derive(Debug, Deserialize, Serialize, PartialEq)]
18+
#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
1919
pub enum Relro {
2020
None,
2121
Partial,

src/pe.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,7 @@ fn get_load_config_val(
224224
)
225225
})
226226
{
227-
let load_config_val = mem[offset..offset + dir_size].pread(0);
228-
229-
match load_config_val {
230-
Ok(val) => Ok(val),
231-
Err(e) => Err(e),
232-
}
227+
mem[offset..offset + dir_size].pread(0)
233228
} else {
234229
Err(scroll::Error::BadOffset(rva))
235230
}

src/shared.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ impl fmt::Display for VecRpath {
2828
let mut s: Vec<String> = Vec::<String>::new();
2929
for v in &self.paths {
3030
match v {
31-
Rpath::Yes(p) => s.push(p.to_string()),
32-
Rpath::YesRW(p) => s.push(p.to_string()),
31+
Rpath::Yes(p) | Rpath::YesRW(p) => s.push(p.to_string()),
3332
Rpath::None => s.push("None".to_string()),
3433
}
3534
}

0 commit comments

Comments
 (0)