diff --git a/src/enclave_proc/resource_manager.rs b/src/enclave_proc/resource_manager.rs index 294c88f2..d67d6eea 100644 --- a/src/enclave_proc/resource_manager.rs +++ b/src/enclave_proc/resource_manager.rs @@ -169,14 +169,13 @@ pub struct EnclaveManager { enclave_handle: Arc>, } -impl ToString for EnclaveState { - fn to_string(&self) -> String { +impl std::fmt::Display for EnclaveState { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - EnclaveState::Empty => "EMPTY", - EnclaveState::Running => "RUNNING", - EnclaveState::Terminating => "TERMINATING", + EnclaveState::Empty => write!(f, "EMPTY"), + EnclaveState::Running => write!(f, "RUNNING"), + EnclaveState::Terminating => write!(f, "TERMINATING"), } - .to_string() } } diff --git a/src/lib.rs b/src/lib.rs index 169e64b0..818c722f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -263,7 +263,7 @@ pub fn describe_eif(eif_path: String) -> NitroCliResult { }; // Check if signature section is present - if measurements.get(&"PCR8".to_string()).is_some() { + if measurements.contains_key("PCR8") { let cert_info = eif_reader .get_certificate_info(measurements) .map_err(|err| {