Add comment to clarify unwrap

This commit is contained in:
Heiko Schaefer 2021-11-22 19:11:22 +01:00
parent a439397c62
commit f5eaa591cb
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -199,11 +199,15 @@ impl CardClient for ScdClient {
let hex = hex::encode(cmd); let hex = hex::encode(cmd);
// (Unwrap is ok here, not having a card_caps is fine)
let ext = if self.card_caps.is_some() let ext = if self.card_caps.is_some()
&& self.card_caps.unwrap().get_ext_support() && 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()) format!("--exlen={} ", self.card_caps.unwrap().get_max_rsp_bytes())
} else { } else {
// ... otherwise don't send "exlen" to scdaemon
"".to_string() "".to_string()
}; };