Skip to content

Commit

Permalink
Minor adjustment from cargo clippy (#463)
Browse files Browse the repository at this point in the history
* cargo clippy.

* Removes test_size.
  • Loading branch information
Lichtso authored May 10, 2023
1 parent e9c2d20 commit 7a87580
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
20 changes: 2 additions & 18 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl<V: Verifier, C: ContextObject> Executable<V, C> {
0
};
Ok(Self {
_verifier: PhantomData::default(),
_verifier: PhantomData,
elf_bytes,
ro_section: Section::Borrowed(0, 0..text_bytes.len()),
text_section_info: SectionInfo {
Expand Down Expand Up @@ -515,7 +515,7 @@ impl<V: Verifier, C: ContextObject> Executable<V, C> {
)?;

Ok(Self {
_verifier: PhantomData::default(),
_verifier: PhantomData,
elf_bytes,
ro_section,
text_section_info,
Expand Down Expand Up @@ -2141,20 +2141,4 @@ mod test {
.expect("failed to read elf file");
ElfExecutable::load(&elf_bytes, loader()).expect("validation failed");
}

#[cfg(all(feature = "jit", not(target_os = "windows"), target_arch = "x86_64"))]
#[test]
fn test_size() {
let mut file = File::open("tests/elfs/noop.so").expect("file open failed");
let mut elf_bytes = Vec::new();
file.read_to_end(&mut elf_bytes)
.expect("failed to read elf file");
let mut executable =
ElfExecutable::from_elf(&elf_bytes, loader()).expect("validation failed");
{
Executable::jit_compile(&mut executable).unwrap();
}

assert_eq!(10546, executable.mem_size());
}
}
2 changes: 1 addition & 1 deletion src/static_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ impl<'a> Analysis<'a> {
};
}
if cfg_node.dominator_parent != dominator_parent {
let mut cfg_node = self.cfg_nodes.get_mut(b).unwrap();
let cfg_node = self.cfg_nodes.get_mut(b).unwrap();
cfg_node.dominator_parent = dominator_parent;
terminate = false;
}
Expand Down

0 comments on commit 7a87580

Please sign in to comment.