@@ -47,8 +47,8 @@ pub trait Hooks {
4747 ) -> Result < Option < String > , PragmaErr > {
4848 Err ( PragmaErr :: NotFound )
4949 }
50- fn sector_size ( & mut self ) { }
51- fn device_characteristics ( & mut self ) {
50+ fn sector_size ( & mut self , handle : MockHandle ) { }
51+ fn device_characteristics ( & mut self , handle : MockHandle ) {
5252 println ! ( "device_characteristics" ) ;
5353 }
5454}
@@ -297,17 +297,17 @@ impl Vfs for MockVfs {
297297 state. hooks . pragma ( * meta, pragma)
298298 }
299299
300- fn sector_size ( & self ) -> i32 {
300+ fn sector_size ( & self , handle : & mut Self :: Handle ) -> VfsResult < i32 > {
301301 let mut state = self . state ( ) ;
302302 state. log ( format_args ! ( "sector_size" ) ) ;
303- state. hooks . sector_size ( ) ;
304- DEFAULT_SECTOR_SIZE
303+ state. hooks . sector_size ( * handle ) ;
304+ Ok ( DEFAULT_SECTOR_SIZE )
305305 }
306306
307- fn device_characteristics ( & self ) -> i32 {
307+ fn device_characteristics ( & self , handle : & mut Self :: Handle ) -> VfsResult < i32 > {
308308 let mut state = self . state ( ) ;
309309 state. log ( format_args ! ( "device_characteristics" ) ) ;
310- state. hooks . device_characteristics ( ) ;
311- DEFAULT_DEVICE_CHARACTERISTICS
310+ state. hooks . device_characteristics ( * handle ) ;
311+ Ok ( DEFAULT_DEVICE_CHARACTERISTICS )
312312 }
313313}
0 commit comments