diff --git a/openpgp-card/src/parse/algo_info.rs b/openpgp-card/src/parse/algo_info.rs index 93dc6e0..bd4a2d0 100644 --- a/openpgp-card/src/parse/algo_info.rs +++ b/openpgp-card/src/parse/algo_info.rs @@ -112,7 +112,7 @@ mod test { 0x1, ]; - let ai = AlgoInfo::try_from(data.to_vec()).unwrap(); + let ai = AlgoInfo::try_from(&data[..]).unwrap(); assert_eq!( ai, @@ -206,7 +206,7 @@ mod test { 0xd, ]; - let ai = AlgoInfo::try_from(data.to_vec()).unwrap(); + let ai = AlgoInfo::try_from(&data[..]).unwrap(); assert_eq!( ai, @@ -360,7 +360,7 @@ mod test { 0x4, 0x1, 0x97, 0x55, 0x1, 0x5, 0x1, ]; - let ai = AlgoInfo::try_from(data.to_vec()).unwrap(); + let ai = AlgoInfo::try_from(&data[..]).unwrap(); assert_eq!( ai, diff --git a/openpgp-card/src/parse/extended_cap.rs b/openpgp-card/src/parse/extended_cap.rs index 9cf6066..4d710dc 100644 --- a/openpgp-card/src/parse/extended_cap.rs +++ b/openpgp-card/src/parse/extended_cap.rs @@ -101,12 +101,13 @@ mod test { use crate::parse::extended_cap::{ExtendedCap, Features}; use hex_literal::hex; use std::collections::HashSet; + use std::convert::TryFrom; use std::iter::FromIterator; #[test] fn test_ec() { let data = hex!("7d 00 0b fe 08 00 00 ff 00 00"); - let ec = ExtendedCap::from(&data).unwrap(); + let ec = ExtendedCap::try_from(&data[..]).unwrap(); assert_eq!( ec,