@@ -20,7 +20,10 @@ use libwebauthn::proto::ctap2::{
2020 Ctap2CredentialType , Ctap2PublicKeyCredentialDescriptor , Ctap2PublicKeyCredentialRpEntity ,
2121 Ctap2PublicKeyCredentialType , Ctap2PublicKeyCredentialUserEntity ,
2222} ;
23+ #[ cfg( not( feature = "nfc" ) ) ]
2324use libwebauthn:: transport:: hid:: list_devices;
25+ #[ cfg( feature = "nfc" ) ]
26+ use libwebauthn:: transport:: nfc:: list_devices;
2427use libwebauthn:: transport:: { Channel as _, Device } ;
2528use libwebauthn:: webauthn:: { CtapError , Error as WebAuthnError , WebAuthn } ;
2629
@@ -156,7 +159,7 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
156159}
157160
158161async fn make_credential_call (
159- channel : & mut HidChannel < ' _ > ,
162+ channel : & mut impl Channel ,
160163 user_id : & [ u8 ] ,
161164 exclude_list : Option < Vec < Ctap2PublicKeyCredentialDescriptor > > ,
162165) -> Result < Ctap2PublicKeyCredentialDescriptor , WebAuthnError > {
@@ -194,7 +197,7 @@ async fn make_credential_call(
194197}
195198
196199async fn get_assertion_call (
197- channel : & mut HidChannel < ' _ > ,
200+ channel : & mut impl Channel ,
198201 allow_list : Vec < Ctap2PublicKeyCredentialDescriptor > ,
199202) -> Result < GetAssertionResponse , WebAuthnError > {
200203 let challenge: [ u8 ; 32 ] = thread_rng ( ) . gen ( ) ;
0 commit comments