Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 authored and arronwy committed Nov 4, 2023
1 parent ad0bdd2 commit 7720457
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion attestation-agent/app/src/rpc/keyprovider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ fn get_kbc_kbs_pair(kpi: &KeyProviderInput) -> Result<(String, String)> {
.ok_or_else(|| anyhow!(ERR_DC_EMPTY))?;

if let Some(parameters_list) = dc.parameters.get(AGENT_NAME) {
let value = if let Some(value) = parameters_list.get(0) {
let value = if let Some(value) = parameters_list.first() {
value
} else {
return Err(anyhow!(ERR_DC_EMPTY));
Expand Down
4 changes: 0 additions & 4 deletions attestation-agent/deps/crypto/src/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
pub mod aes256ctr;
pub mod aes256gcm;

pub use aes256ctr::*;
pub use aes256gcm::*;

pub mod rsa;
pub use self::rsa::*;
4 changes: 0 additions & 4 deletions attestation-agent/deps/crypto/src/rust/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
pub mod aes256ctr;
pub mod aes256gcm;

pub use aes256ctr::*;
pub use aes256gcm::*;

pub mod rsa;
pub use self::rsa::*;
2 changes: 1 addition & 1 deletion image-rs/src/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<'a> PullClient<'a> {
let layer_metas = self
.async_pull_layers(vec![bootstrap_desc], &[diff_id], decrypt_config, meta_store)
.await?;
match layer_metas.get(0) {
match layer_metas.first() {
Some(b) => Ok(b.clone()),
None => Err(anyhow!("Failed to download this bootstrap layer")),
}
Expand Down
2 changes: 1 addition & 1 deletion ocicrypt-rs/src/keywrap/keyprovider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl KeyProviderKeyWrapProtocolOutput {
#[cfg(feature = "keywrap-keyprovider-native")]
fn from_native(annotation: &str, dc_config: &DecryptConfig) -> Result<Self> {
let kbc_kbs_pair = if let Some(list) = dc_config.param.get("attestation-agent") {
list.get(0)
list.first()
.ok_or_else(|| anyhow!("keyprovider: empty kbc::kbs pair"))?
} else {
return Err(anyhow!("keyprovider: not supported attestation agent"));
Expand Down

0 comments on commit 7720457

Please sign in to comment.