@@ -343,13 +343,11 @@ fn dump(args: &[String]) -> Result<(), ()> {
343343}
344344
345345fn meta_dump ( args : & [ String ] ) -> Result < ( ) , ( ) > {
346- use twinleaf:: data:: Device ;
347346 let opts = tio_opts ( ) ;
348347 let ( _matches, root, route) = tio_parseopts ( & opts, args) ;
349348
350349 let proxy = proxy:: Interface :: new ( & root) ;
351- let device = proxy. device_full ( route) . unwrap ( ) ;
352- let mut device = Device :: new ( device) ;
350+ let mut device = twinleaf:: Device :: open ( & proxy, route) ;
353351
354352 let meta = device. get_metadata ( ) ;
355353 println ! ( "{:?}" , meta. device) ;
@@ -378,13 +376,11 @@ fn print_sample(sample: &twinleaf::data::Sample) {
378376}
379377
380378fn data_dump ( args : & [ String ] ) -> Result < ( ) , ( ) > {
381- use twinleaf:: data:: Device ;
382379 let opts = tio_opts ( ) ;
383380 let ( _matches, root, route) = tio_parseopts ( & opts, args) ;
384381
385382 let proxy = proxy:: Interface :: new ( & root) ;
386- let device = proxy. device_full ( route) . unwrap ( ) ;
387- let mut device = Device :: new ( device) ;
383+ let mut device = twinleaf:: Device :: open ( & proxy, route) ;
388384
389385 loop {
390386 print_sample ( & device. next ( ) ) ;
@@ -433,7 +429,6 @@ fn log(args: &[String]) -> Result<(), ()> {
433429}
434430
435431fn log_metadata ( args : & [ String ] ) -> Result < ( ) , ( ) > {
436- use twinleaf:: data:: Device ;
437432 let mut opts = tio_opts ( ) ;
438433 opts. optopt (
439434 "f" ,
@@ -448,8 +443,7 @@ fn log_metadata(args: &[String]) -> Result<(), ()> {
448443 }
449444
450445 let proxy = proxy:: Interface :: new ( & root) ;
451- let device = proxy. device_full ( route) . unwrap ( ) ;
452- let mut device = Device :: new ( device) ;
446+ let mut device = twinleaf:: Device :: open ( & proxy, route) ;
453447
454448 let meta = device. get_metadata ( ) ;
455449 let output_path = if let Some ( path) = matches. opt_str ( "f" ) {
0 commit comments