From f5eaa591cb9653f616d817c4fa65a96ec7ca5253 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Mon, 22 Nov 2021 19:11:22 +0100 Subject: [PATCH] Add comment to clarify unwrap --- scdc/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scdc/src/lib.rs b/scdc/src/lib.rs index cc516ee..d4d531d 100644 --- a/scdc/src/lib.rs +++ b/scdc/src/lib.rs @@ -199,11 +199,15 @@ impl CardClient for ScdClient { let hex = hex::encode(cmd); + // (Unwrap is ok here, not having a card_caps is fine) let ext = if self.card_caps.is_some() && self.card_caps.unwrap().get_ext_support() { + // If we know about card_caps, and can do extended length we + // set "exlen" accordingly ... format!("--exlen={} ", self.card_caps.unwrap().get_max_rsp_bytes()) } else { + // ... otherwise don't send "exlen" to scdaemon "".to_string() };