@@ -52,11 +52,7 @@ pub trait NorFlash: ReadNorFlash {
52
52
impl < T : ReadNorFlash > ReadNorFlash for & mut T {
53
53
const READ_SIZE : usize = T :: READ_SIZE ;
54
54
55
- async fn read (
56
- & mut self ,
57
- offset : u32 ,
58
- bytes : & mut [ u8 ] ,
59
- ) -> Result < ( ) , <& mut T as ErrorType >:: Error > {
55
+ async fn read ( & mut self , offset : u32 , bytes : & mut [ u8 ] ) -> Result < ( ) , Self :: Error > {
60
56
T :: read ( self , offset, bytes) . await
61
57
}
62
58
@@ -69,15 +65,11 @@ impl<T: NorFlash> NorFlash for &mut T {
69
65
const WRITE_SIZE : usize = T :: WRITE_SIZE ;
70
66
const ERASE_SIZE : usize = T :: ERASE_SIZE ;
71
67
72
- async fn erase ( & mut self , from : u32 , to : u32 ) -> Result < ( ) , < & mut T as ErrorType > :: Error > {
68
+ async fn erase ( & mut self , from : u32 , to : u32 ) -> Result < ( ) , Self :: Error > {
73
69
T :: erase ( self , from, to) . await
74
70
}
75
71
76
- async fn write (
77
- & mut self ,
78
- offset : u32 ,
79
- bytes : & [ u8 ] ,
80
- ) -> Result < ( ) , <& mut T as ErrorType >:: Error > {
72
+ async fn write ( & mut self , offset : u32 , bytes : & [ u8 ] ) -> Result < ( ) , Self :: Error > {
81
73
T :: write ( self , offset, bytes) . await
82
74
}
83
75
}
0 commit comments