Skip to content

Commit

Permalink
Merge pull request #17 from Nitrokey/clippy-fixes
Browse files Browse the repository at this point in the history
Fix clippy warnings
  • Loading branch information
sosthene-nitrokey authored Mar 4, 2024
2 parents 012227d + 7381904 commit 668332a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/lib/commands.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use cbor_smol::cbor_deserialize;
pub use ctap_types::ctap1::Error as U2fError;
use heapless::Vec;

use heapless_bytes::{Bytes, Bytes32};
Expand Down Expand Up @@ -1146,7 +1145,7 @@ where
.trussed
.read_dir_first(w.options.location, rp_rk_dir(rp_id_hash), None,))
.entry
.map(|entry| PathBuf::try_from(entry.path()).unwrap());
.map(|entry| PathBuf::from(entry.path()));

// following reads
while let Some(path) = maybe_path {
Expand All @@ -1155,7 +1154,7 @@ where

maybe_path = syscall!(w.trussed.read_dir_next())
.entry
.map(|entry| PathBuf::try_from(entry.path()).unwrap());
.map(|entry| PathBuf::from(entry.path()));
}

// TODO finish
Expand Down
4 changes: 2 additions & 2 deletions src/lib/ctap_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ where
PublicKeyCredentialUserEntity {
id: Bytes::from_slice(&[3u8; 16]).unwrap(),
icon: None,
name: Some("name".try_into().unwrap()),
display_name: Some("display".try_into().unwrap()),
name: Some("name".into()),
display_name: Some("display".into()),
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/lib/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ where

#[inline(never)]
fn get_webcrypt_cmd(&self, keyh: &[u8]) -> Result<ExtWebcryptCmd, WebcryptError> {
let webcrypt: WebcryptRequest = keyh.try_into().map_err(|_| Error::BadFormat)?;
let webcrypt: WebcryptRequest = keyh.into();
webcrypt.try_into()
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub enum Error {
AlreadyInDatabase = 0xF7,
NotFound = 0xF8,
AssertFailed = 0xF9,
#[allow(clippy::enum_variant_names)]
InternalError = 0xFA,
MemoryFull = 0xFB,
NotImplemented = 0xFC,
Expand Down

0 comments on commit 668332a

Please sign in to comment.