@@ -41,7 +41,7 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
41
41
/// - `MAK` = master acknowledge
42
42
/// - `NMAK` = master no acknowledge
43
43
/// - `SP` = stop condition
44
- async fn read < ' a > ( & ' a mut self , address : A , read : & ' a mut [ u8 ] ) -> Result < ( ) , Self :: Error > ;
44
+ async fn read ( & mut self , address : A , read : & mut [ u8 ] ) -> Result < ( ) , Self :: Error > ;
45
45
46
46
/// Writes bytes to slave with address `address`
47
47
///
@@ -59,7 +59,7 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
59
59
/// - `SAK` = slave acknowledge
60
60
/// - `Bi` = ith byte of data
61
61
/// - `SP` = stop condition
62
- async fn write < ' a > ( & ' a mut self , address : A , write : & ' a [ u8 ] ) -> Result < ( ) , Self :: Error > ;
62
+ async fn write ( & mut self , address : A , write : & [ u8 ] ) -> Result < ( ) , Self :: Error > ;
63
63
64
64
/// Writes bytes to slave with address `address` and then reads enough bytes to fill `read` *in a
65
65
/// single transaction*.
@@ -83,11 +83,11 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
83
83
/// - `MAK` = master acknowledge
84
84
/// - `NMAK` = master no acknowledge
85
85
/// - `SP` = stop condition
86
- async fn write_read < ' a > (
87
- & ' a mut self ,
86
+ async fn write_read (
87
+ & mut self ,
88
88
address : A ,
89
- write : & ' a [ u8 ] ,
90
- read : & ' a mut [ u8 ] ,
89
+ write : & [ u8 ] ,
90
+ read : & mut [ u8 ] ,
91
91
) -> Result < ( ) , Self :: Error > ;
92
92
93
93
/// Execute the provided operations on the I2C bus as a single transaction.
@@ -103,35 +103,35 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
103
103
/// - `SAD+R/W` = slave address followed by bit 1 to indicate reading or 0 to indicate writing
104
104
/// - `SR` = repeated start condition
105
105
/// - `SP` = stop condition
106
- async fn transaction < ' a , ' b > (
107
- & ' a mut self ,
106
+ async fn transaction (
107
+ & mut self ,
108
108
address : A ,
109
- operations : & ' a mut [ Operation < ' b > ] ,
109
+ operations : & mut [ Operation < ' _ > ] ,
110
110
) -> Result < ( ) , Self :: Error > ;
111
111
}
112
112
113
113
impl < A : AddressMode , T : I2c < A > > I2c < A > for & mut T {
114
- async fn read < ' a > ( & ' a mut self , address : A , buffer : & ' a mut [ u8 ] ) -> Result < ( ) , Self :: Error > {
114
+ async fn read ( & mut self , address : A , buffer : & mut [ u8 ] ) -> Result < ( ) , Self :: Error > {
115
115
T :: read ( self , address, buffer) . await
116
116
}
117
117
118
- async fn write < ' a > ( & ' a mut self , address : A , bytes : & ' a [ u8 ] ) -> Result < ( ) , Self :: Error > {
118
+ async fn write ( & mut self , address : A , bytes : & [ u8 ] ) -> Result < ( ) , Self :: Error > {
119
119
T :: write ( self , address, bytes) . await
120
120
}
121
121
122
- async fn write_read < ' a > (
123
- & ' a mut self ,
122
+ async fn write_read (
123
+ & mut self ,
124
124
address : A ,
125
- bytes : & ' a [ u8 ] ,
126
- buffer : & ' a mut [ u8 ] ,
125
+ bytes : & [ u8 ] ,
126
+ buffer : & mut [ u8 ] ,
127
127
) -> Result < ( ) , Self :: Error > {
128
128
T :: write_read ( self , address, bytes, buffer) . await
129
129
}
130
130
131
- async fn transaction < ' a , ' b > (
132
- & ' a mut self ,
131
+ async fn transaction (
132
+ & mut self ,
133
133
address : A ,
134
- operations : & ' a mut [ Operation < ' b > ] ,
134
+ operations : & mut [ Operation < ' _ > ] ,
135
135
) -> Result < ( ) , Self :: Error > {
136
136
T :: transaction ( self , address, operations) . await
137
137
}
0 commit comments