Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Feb 16, 2024
1 parent a4d938a commit 1037f94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 1 addition & 6 deletions fuzz/fuzz_targets/fuzz_target_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@ use arbitrary::{Arbitrary, Unstructured};
use interchange::Channel;
use libfuzzer_sys::fuzz_target;

use std::convert::TryFrom;

#[derive(Debug)]
struct StatusWrapper(iso7816::Status);

impl<'a> Arbitrary<'a> for StatusWrapper {
fn arbitrary(u: &mut Unstructured<'a>) -> Result<StatusWrapper, arbitrary::Error> {
let (tag1, tag2) = u.arbitrary()?;
Ok(StatusWrapper(
iso7816::Status::try_from((tag1, tag2))
.map_err(|_| arbitrary::Error::IncorrectFormat)?,
))
Ok(StatusWrapper(iso7816::Status::from((tag1, tag2))))
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use crate::{
interchanges::{self, Responder},
response, Command,
};
use core::convert::TryInto;

use iso7816::{command::FromSliceError, Aid, Instruction, Result, Status};

Expand Down Expand Up @@ -182,12 +181,12 @@ impl<'pipe> ApduDispatch<'pipe> {
// acknowledge
Interface::Contact => {
self.contact
.respond(Status::Success.try_into().unwrap())
.respond(Status::Success.into())
.expect("Could not respond");
}
Interface::Contactless => {
self.contactless
.respond(Status::Success.try_into().unwrap())
.respond(Status::Success.into())
.expect("Could not respond");
}
}
Expand Down

0 comments on commit 1037f94

Please sign in to comment.