This commit is contained in:
Heiko Schaefer 2022-02-18 12:53:05 +01:00
parent e01c79e857
commit 265587252a
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D
2 changed files with 3 additions and 7 deletions

View file

@ -342,7 +342,7 @@ pub fn test_set_user_data(
// read all the fields back again, expect equal data
let ch = card_tx.cardholder_related_data()?;
assert_eq!(ch.name().as_deref(), Some("Bar<<Foo".as_bytes()));
assert_eq!(ch.name(), Some("Bar<<Foo".as_bytes()));
assert_eq!(
ch.lang().expect("Language setting is None"),
&[['d', 'e'].into(), ['e', 'n'].into()]
@ -519,10 +519,7 @@ pub fn test_verify(
card_tx.set_name(b"Admin<<Hello")?;
let cardholder = card_tx.cardholder_related_data()?;
assert_eq!(
cardholder.name().as_deref(),
Some("Admin<<Hello".as_bytes())
);
assert_eq!(cardholder.name(), Some("Admin<<Hello".as_bytes()));
card_tx.verify_pw1("123456")?;

View file

@ -16,8 +16,7 @@ pub(crate) fn cards() -> Result<Vec<Box<dyn CardBackend>>, Error> {
}
pub(crate) fn open_card(ident: &str) -> Result<Box<dyn CardBackend>, Error> {
PcscCard::open_by_ident(ident, None)
.map(|pc| Box::new(pc) as Box<dyn CardBackend>)
PcscCard::open_by_ident(ident, None).map(Into::into)
}
pub(crate) fn verify_to_user<'app, 'open>(