From 40de8f71af07242f4ef034b4ecb03495c62cfeba Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 17 Jul 2021 14:20:39 +0800 Subject: [PATCH] chore: output format --- src/piv.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/piv.rs b/src/piv.rs index fa9455e..93a5cce 100644 --- a/src/piv.rs +++ b/src/piv.rs @@ -47,7 +47,8 @@ fn print_cert_info(yubikey: &mut YubiKey, slot: SlotId) -> XResult<()> { let cert = match Certificate::read(yubikey, slot) { Ok(c) => c, Err(e) => { - debugging!("error reading certificate in slot {:?}: {}", slot, e); + let slot_id: u8 = slot.into(); + debugging!("error reading certificate in slot {:?}, id: {:x}: {}", slot, slot_id, e); return simple_error!("error reading certificate in slot {:?}: {}", slot, e); } }; @@ -57,7 +58,7 @@ fn print_cert_info(yubikey: &mut YubiKey, slot: SlotId) -> XResult<()> { let fingerprint_sha256 = Sha256::digest(&buf); let slot_id: u8 = slot.into(); - success!("Slot: {}", format!("{:x}", slot_id)); + success!("Slot: {:?}, id: {:x}", slot, slot_id); rust_util::util_msg::when(MessageType::DEBUG, || { let cert_pem_obj = Pem {