File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 3030//! ```
3131
3232use std:: ffi:: { CStr , CString } ;
33+ use std:: io:: Write ;
3334use std:: marker:: PhantomData ;
3435use std:: thread:: sleep;
3536use std:: time:: Duration ;
@@ -171,7 +172,7 @@ impl<'a> HandlerInCtx<Ctx> for PcscCard<'a> {
171172 & self ,
172173 _: Ctx ,
173174 command : & [ u8 ] ,
174- response : & mut [ u8 ] ,
175+ mut response : & mut [ u8 ] ,
175176 ) -> std:: result:: Result < usize , HandleError > {
176177 let tx = Vec :: from ( command) ;
177178 let rx = self . transmit ( & tx) . unwrap ( ) ;
@@ -180,6 +181,9 @@ impl<'a> HandlerInCtx<Ctx> for PcscCard<'a> {
180181 return Err ( HandleError :: NotEnoughBuffer ( len) ) ;
181182 }
182183
183- Ok ( len)
184+ match response. write ( & rx) {
185+ Ok ( size) => Ok ( size) ,
186+ Err ( e) => Err ( HandleError :: Nfc ( Box :: new ( e) ) ) ,
187+ }
184188 }
185189}
You can’t perform that action at this time.
0 commit comments