From b09f3c6fe25137d7477ae31d6dde775be6982a20 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Tue, 12 Nov 2024 11:34:43 -0600 Subject: [PATCH] Lint fixes --- src/qos_client/src/cli/mod.rs | 8 ++++---- src/qos_client/src/cli/services.rs | 6 +++--- src/qos_core/src/protocol/error.rs | 6 +++--- src/qos_core/src/protocol/services/boot.rs | 4 ++-- src/qos_host/src/cli.rs | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/qos_client/src/cli/mod.rs b/src/qos_client/src/cli/mod.rs index 417210d4..f6ef16c0 100644 --- a/src/qos_client/src/cli/mod.rs +++ b/src/qos_client/src/cli/mod.rs @@ -203,13 +203,13 @@ pub enum Command { ExportKey, /// Inject a quorum key into a non-fully provisioned enclave InjectKey, - /// Verify a signature from qos_p256 pair. + /// Verify a signature from `qos_p256` pair. P256Verify, /// Sign with a p256 signature. P256Sign, - /// Encrypt to a qos_p256 public key. + /// Encrypt to a `qos_p256` public key. P256AsymmetricEncrypt, - /// Decrypt a payload encrypted to a qos_p256 public key. + /// Decrypt a payload encrypted to a `qos_p256` public key. P256AsymmetricDecrypt, } @@ -979,7 +979,7 @@ impl ClientOpts { } fn secret_path(&self) -> Option { - self.parsed.single(SECRET_PATH).map(String::clone) + self.parsed.single(SECRET_PATH).cloned() } fn share_path(&self) -> String { diff --git a/src/qos_client/src/cli/services.rs b/src/qos_client/src/cli/services.rs index f240c41a..bee01c6f 100644 --- a/src/qos_client/src/cli/services.rs +++ b/src/qos_client/src/cli/services.rs @@ -2783,7 +2783,7 @@ mod tests { )); let output = String::from_utf8(vec_out).unwrap(); - let output: Vec<_> = output.trim().split('\n').collect(); + let output: Vec<_> = output.lines().collect(); assert_eq!( output.last().unwrap(), &"Is this the correct namespace nonce: 2? (yes/no)" @@ -2807,7 +2807,7 @@ mod tests { )); let output = String::from_utf8(vec_out).unwrap(); - let output: Vec<_> = output.trim().split('\n').collect(); + let output: Vec<_> = output.lines().collect(); assert_eq!( output.last().unwrap(), &"Does this AWS IAM role belong to the intended organization: pr3? (yes/no)" @@ -2831,7 +2831,7 @@ mod tests { )); let output = String::from_utf8(vec_out).unwrap(); - let output: Vec<_> = output.trim().split('\n').collect(); + let output: Vec<_> = output.lines().collect(); assert_eq!( output[3], diff --git a/src/qos_core/src/protocol/error.rs b/src/qos_core/src/protocol/error.rs index 74e5f4bb..767ef63e 100644 --- a/src/qos_core/src/protocol/error.rs +++ b/src/qos_core/src/protocol/error.rs @@ -22,7 +22,7 @@ pub enum ProtocolError { /// Cryptography error /// Approval was not valid for a manifest. InvalidManifestApproval(boot::Approval), - /// [boot::ManifestEnvelope] did not have approvals + /// [`boot::ManifestEnvelope`] did not have approvals NotEnoughApprovals, /// Protocol Message could not be matched against an available route. /// Ensure the executor is in the correct phase. @@ -93,9 +93,9 @@ pub enum ProtocolError { BadShareSetApprovals, /// Could not verify a message against an approval CouldNotVerifyApproval, - /// Not a member of the [boot::ShareSet]. + /// Not a member of the [`boot::ShareSet`]. NotShareSetMember, - /// Not a member of the [boot::ManifestSet]. + /// Not a member of the [`boot::ManifestSet`]. NotManifestSetMember, /// `qos_p256` Error wrapper. P256Error(qos_p256::P256Error), diff --git a/src/qos_core/src/protocol/services/boot.rs b/src/qos_core/src/protocol/services/boot.rs index 3bf30a9c..0341a448 100644 --- a/src/qos_core/src/protocol/services/boot.rs +++ b/src/qos_core/src/protocol/services/boot.rs @@ -154,7 +154,7 @@ pub struct QuorumMember { /// cryptographically guaranteed and thus should not be trusted without /// verification. pub alias: String, - /// P256Public as bytes + /// `P256Public` as bytes #[serde(with = "qos_hex::serde")] pub pub_key: Vec, } @@ -272,7 +272,7 @@ pub struct PatchSet { #[cfg_attr(any(feature = "mock", test), derive(Default))] pub struct Namespace { /// The namespace. This should be unique relative to other namespaces the - /// organization running QuorumOs has. + /// organization running `QuorumOs` has. pub name: String, /// A monotonically increasing value, used to identify the order in which /// manifests for this namespace have been created. This is used to prevent diff --git a/src/qos_host/src/cli.rs b/src/qos_host/src/cli.rs index 47a2bd29..818d2e30 100644 --- a/src/qos_host/src/cli.rs +++ b/src/qos_host/src/cli.rs @@ -138,7 +138,7 @@ impl HostOpts { } fn base_path(&self) -> Option { - self.parsed.single(ENDPOINT_BASE_PATH).map(Clone::clone) + self.parsed.single(ENDPOINT_BASE_PATH).cloned() } #[cfg(feature = "vm")]