Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rmalmain committed Dec 20, 2023
1 parent a88b11f commit 5b2228f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions libafl_qemu/src/breakpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ impl Borrow<GuestAddr> for Breakpoint {

impl Breakpoint {
// Emu will return with the breakpoint as exit reason.
#[must_use]
pub fn without_command(addr: GuestAddr, disable_on_trigger: bool) -> Self {
Self {
addr,
Expand All @@ -56,6 +57,7 @@ impl Breakpoint {
}

// Emu will execute the command when it meets the breakpoint.
#[must_use]
pub fn with_command(addr: GuestAddr, cmd: Command, disable_on_trigger: bool) -> Self {
Self {
addr,
Expand All @@ -65,6 +67,7 @@ impl Breakpoint {
}
}

#[must_use]
pub fn addr(&self) -> GuestAddr {
self.addr
}
Expand Down
6 changes: 4 additions & 2 deletions libafl_qemu/src/emu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ pub struct CommandInput {
}

impl CommandInput {
#[must_use]
pub fn phys(addr: GuestPhysAddr, max_input_size: GuestReg, cpu: Option<CPU>) -> Self {
Self {
addr: GuestAddrKind::Physical(addr),
Expand All @@ -114,6 +115,7 @@ impl CommandInput {
}
}

#[must_use]
pub fn virt(addr: GuestVirtAddr, max_input_size: GuestReg, cpu: CPU) -> Self {
Self {
addr: GuestAddrKind::Virtual(addr),
Expand Down Expand Up @@ -798,8 +800,8 @@ impl From<SyncExitError> for HandlerError {
impl fmt::Display for EmuExitReason {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match self {
EmuExitReason::End(shutdown_cause) => write!(f, "End: {:?}", shutdown_cause),
EmuExitReason::Breakpoint(bp) => write!(f, "{}", bp),
EmuExitReason::End(shutdown_cause) => write!(f, "End: {shutdown_cause:?}"),
EmuExitReason::Breakpoint(bp) => write!(f, "{bp}"),
EmuExitReason::SyncBackdoor(sync_backdoor) => {
write!(f, "Sync backdoor exit: {sync_backdoor}")
}
Expand Down
2 changes: 1 addition & 1 deletion libafl_qemu/src/emu/usermode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ where
unsafe { mmap_next_start = start };
}

#[allow(clippy::cast_sign_loss)]
#[allow(clippy::cast_sign_loss, clippy::unused_self)]
fn mmap(
&self,
addr: GuestAddr,
Expand Down

0 comments on commit 5b2228f

Please sign in to comment.