diff --git a/e2e_tests/src/lib.rs b/e2e_tests/src/lib.rs index d2c80b86..4b4d8d5c 100644 --- a/e2e_tests/src/lib.rs +++ b/e2e_tests/src/lib.rs @@ -9,7 +9,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, unconditional_recursion, unused, unused_allocation, diff --git a/e2e_tests/tests/mod.rs b/e2e_tests/tests/mod.rs index 1566fe8e..f023d630 100644 --- a/e2e_tests/tests/mod.rs +++ b/e2e_tests/tests/mod.rs @@ -10,7 +10,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, unconditional_recursion, unused, unused_allocation, diff --git a/fuzz/build.rs b/fuzz/build.rs index 337a1f9c..83491b34 100644 --- a/fuzz/build.rs +++ b/fuzz/build.rs @@ -9,7 +9,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, unconditional_recursion, unused, unused_allocation, diff --git a/src/bin/main.rs b/src/bin/main.rs index f8acde02..cf0705e5 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -18,7 +18,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, unconditional_recursion, unused, unused_allocation, diff --git a/src/key_info_managers/on_disk_manager/mod.rs b/src/key_info_managers/on_disk_manager/mod.rs index 717b93d3..3cf018b3 100644 --- a/src/key_info_managers/on_disk_manager/mod.rs +++ b/src/key_info_managers/on_disk_manager/mod.rs @@ -79,8 +79,8 @@ impl ApplicationName { } #[allow(deprecated)] -impl std::fmt::Display for ApplicationName { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for ApplicationName { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.name) } } @@ -152,7 +152,7 @@ impl fmt::Display for KeyTriple { impl TryFrom for KeyTriple { type Error = String; - fn try_from(key_identity: KeyIdentity) -> ::std::result::Result { + fn try_from(key_identity: KeyIdentity) -> std::result::Result { let provider_id = match key_identity.provider.uuid().as_str() { CoreProvider::PROVIDER_UUID => Ok(ProviderId::Core), #[cfg(feature = "cryptoauthlib-provider")] @@ -188,7 +188,7 @@ impl TryFrom<(KeyTriple, ProviderIdentity, AuthType)> for KeyIdentity { fn try_from( (key_triple, provider_identity, auth_type): (KeyTriple, ProviderIdentity, AuthType), - ) -> ::std::result::Result { + ) -> std::result::Result { // Result types required by clippy as Err result has the possibility of not being compiled. let provider_uuid = match key_triple.provider_id { ProviderId::Core => Ok::( @@ -489,7 +489,7 @@ impl OnDiskKeyInfoManager { fs::remove_file(&key_name_file_path)?; } - let mut mapping_file = fs::File::create(&key_name_file_path).map_err(|e| { + let mut mapping_file = File::create(&key_name_file_path).map_err(|e| { error!( "Failed to create Key Info Mapping file at {:?}", key_name_file_path diff --git a/src/lib.rs b/src/lib.rs index 99864016..74b96a32 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, unconditional_recursion, unused, unused_allocation, diff --git a/src/providers/cryptoauthlib/mod.rs b/src/providers/cryptoauthlib/mod.rs index 2b5a42a4..fb1c94be 100644 --- a/src/providers/cryptoauthlib/mod.rs +++ b/src/providers/cryptoauthlib/mod.rs @@ -653,7 +653,7 @@ impl ProviderBuilder { }; Provider::new( self.provider_name.ok_or_else(|| { - std::io::Error::new(std::io::ErrorKind::InvalidData, "missing provider name") + std::io::Error::new(ErrorKind::InvalidData, "missing provider name") })?, self.key_info_store .ok_or_else(|| Error::new(ErrorKind::InvalidData, "missing key info store"))?, diff --git a/src/providers/mbed_crypto/key_management.rs b/src/providers/mbed_crypto/key_management.rs index da17e8ce..eef1ccc2 100644 --- a/src/providers/mbed_crypto/key_management.rs +++ b/src/providers/mbed_crypto/key_management.rs @@ -175,7 +175,7 @@ impl Provider { .expect("Grabbing key handle mutex failed"); let id = key::Id::from_persistent_key_id(key_id)?; - let key_attributes = key::Attributes::from_key_id(id)?; + let key_attributes = Attributes::from_key_id(id)?; let buffer_size = key_attributes.export_public_key_output_size()?; let mut buffer = vec![0u8; buffer_size]; @@ -206,7 +206,7 @@ impl Provider { .expect("Grabbing key handle mutex failed"); let id = key::Id::from_persistent_key_id(key_id)?; - let key_attributes = key::Attributes::from_key_id(id)?; + let key_attributes = Attributes::from_key_id(id)?; let buffer_size = key_attributes.export_key_output_size()?; let mut buffer = vec![0u8; buffer_size]; diff --git a/src/providers/mbed_crypto/mod.rs b/src/providers/mbed_crypto/mod.rs index 73a9a96a..3a43ec9e 100644 --- a/src/providers/mbed_crypto/mod.rs +++ b/src/providers/mbed_crypto/mod.rs @@ -375,9 +375,8 @@ impl ProviderBuilder { /// Build into a MbedProvider pub fn build(self) -> std::io::Result { Provider::new( - self.provider_name.ok_or_else(|| { - std::io::Error::new(std::io::ErrorKind::InvalidData, "missing provider name") - })?, + self.provider_name + .ok_or_else(|| Error::new(ErrorKind::InvalidData, "missing provider name"))?, self.key_info_store .ok_or_else(|| Error::new(ErrorKind::InvalidData, "missing key info store"))?, ) diff --git a/src/providers/mod.rs b/src/providers/mod.rs index 80df7442..e39c86bd 100644 --- a/src/providers/mod.rs +++ b/src/providers/mod.rs @@ -86,16 +86,16 @@ impl ProviderIdentity { impl TryFrom for ProviderId { type Error = String; - fn try_from(provider_identity: ProviderIdentity) -> ::std::result::Result { + fn try_from(provider_identity: ProviderIdentity) -> std::result::Result { let provider_id = match provider_identity.uuid.as_str() { #[cfg(feature = "cryptoauthlib-provider")] crate::providers::cryptoauthlib::Provider::PROVIDER_UUID => Ok(ProviderId::CryptoAuthLib), #[cfg(feature = "mbed-crypto-provider")] - crate::providers::mbed_crypto::Provider::PROVIDER_UUID => Ok(ProviderId::MbedCrypto), + mbed_crypto::Provider::PROVIDER_UUID => Ok(ProviderId::MbedCrypto), #[cfg(feature = "pkcs11-provider")] - crate::providers::pkcs11::Provider::PROVIDER_UUID => Ok(ProviderId::Pkcs11), + pkcs11::Provider::PROVIDER_UUID => Ok(ProviderId::Pkcs11), #[cfg(feature = "tpm-provider")] - crate::providers::tpm::Provider::PROVIDER_UUID => Ok(ProviderId::Tpm), + tpm::Provider::PROVIDER_UUID => Ok(ProviderId::Tpm), #[cfg(feature = "trusted-service-provider")] crate::providers::trusted_service::Provider::PROVIDER_UUID => Ok(ProviderId::TrustedService), _ => Err(format!("Cannot convert from ProviderIdentity to ProviderId.\nProvider \"{}\" is not recognised.\nCould be it does not exist, or Parsec was not compiled with the required provider feature flags.", provider_identity.uuid)), diff --git a/src/providers/pkcs11/mod.rs b/src/providers/pkcs11/mod.rs index 06166980..212d1b7c 100644 --- a/src/providers/pkcs11/mod.rs +++ b/src/providers/pkcs11/mod.rs @@ -586,9 +586,8 @@ impl ProviderBuilder { }; Ok(Provider::new( - self.provider_name.ok_or_else(|| { - std::io::Error::new(std::io::ErrorKind::InvalidData, "missing provider name") - })?, + self.provider_name + .ok_or_else(|| Error::new(ErrorKind::InvalidData, "missing provider name"))?, self.key_info_store .ok_or_else(|| Error::new(ErrorKind::InvalidData, "missing key info store"))?, backend, diff --git a/src/providers/tpm/mod.rs b/src/providers/tpm/mod.rs index e45bab1d..6983972f 100644 --- a/src/providers/tpm/mod.rs +++ b/src/providers/tpm/mod.rs @@ -418,7 +418,7 @@ impl ProviderBuilder { } Ok(Provider::new( self.provider_name.ok_or_else(|| { - std::io::Error::new(std::io::ErrorKind::InvalidData, "missing provider name") + std::io::Error::new(ErrorKind::InvalidData, "missing provider name") })?, self.key_info_store.ok_or_else(|| { std::io::Error::new(ErrorKind::InvalidData, "missing key info store") diff --git a/src/utils/cli.rs b/src/utils/cli.rs index 12c1613b..92c0e845 100644 --- a/src/utils/cli.rs +++ b/src/utils/cli.rs @@ -5,6 +5,7 @@ // WARNING: This file should be only updated in a non-breaking way. CLI flags should not be // removed, new flags should be tested. // See https://github.com/parallaxsecond/parsec/issues/392 for details. +#![allow(unused_qualifications)] use structopt::StructOpt; diff --git a/src/utils/service_builder.rs b/src/utils/service_builder.rs index ceb9a9d1..99b7e949 100644 --- a/src/utils/service_builder.rs +++ b/src/utils/service_builder.rs @@ -362,7 +362,7 @@ unsafe fn get_provider( ); let tcti_name_conf = TctiNameConf::from_str(tcti).map_err(|_| { - std::io::Error::new(ErrorKind::InvalidData, "Invalid TCTI configuration string") + Error::new(ErrorKind::InvalidData, "Invalid TCTI configuration string") })?; if *skip_if_no_tpm == Some(true) { // TODO: When the TPM Provider uses the new TctiContext, pass it directly to the