Skip to content

Commit

Permalink
Merge pull request #596 from 7flying/fix-clippy-warnings
Browse files Browse the repository at this point in the history
chore: fix clippy warnings after rustc v1.75.0 update
  • Loading branch information
mergify[bot] authored Jan 3, 2024
2 parents 4877123 + bbb7ae9 commit bad870f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client-linuxapp/src/reencrypt/rebind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn get_clevis_keyslot(dev: &mut CryptDevice, clevis_token: u32) -> Result<u32> {
.ok_or_else(|| anyhow!("No keyslots found in clevis token"))?
.as_array()
.ok_or_else(|| anyhow!("Invalid JSON type returned from clevis token keyslots"))?
.get(0)
.first()
.ok_or_else(|| anyhow!("No keyslots found in clevis token"))?
.as_str()
.ok_or_else(|| anyhow!("Invalid JSON type returned from clevis token keyslot"))?
Expand Down
2 changes: 1 addition & 1 deletion data-formats/src/publickey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl X5Chain {
}

pub fn leaf_certificate(&self) -> Option<&X509> {
self.chain.get(0)
self.chain.first()
}

pub fn from_slice(data: &[u8]) -> Result<Self> {
Expand Down
4 changes: 2 additions & 2 deletions data-formats/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl Nonce {
}

pub fn from_value(val: &[u8]) -> Result<Self, Error> {
Ok(Nonce(val.try_into().map_err(|_| Error::IncorrectNonce)?))
Ok(Nonce(val.into()))
}

pub fn value(&self) -> &[u8] {
Expand Down Expand Up @@ -326,7 +326,7 @@ impl Guid {
if data[0] != EAT_RAND {
Err(Error::InconsistentValue("Invalid UEID"))
} else {
Ok(Guid(data[1..].try_into().unwrap()))
Ok(Guid(data[1..].into()))
}
}
}
Expand Down

0 comments on commit bad870f

Please sign in to comment.