@@ -107,9 +107,10 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
107107 ) -> Self :: WriteReadFuture < ' a > ;
108108
109109 /// Future returned by the `transaction` method.
110- type TransactionFuture < ' a > : Future < Output = Result < ( ) , Self :: Error > > + ' a
110+ type TransactionFuture < ' a , ' b > : Future < Output = Result < ( ) , Self :: Error > > + ' a
111111 where
112- Self : ' a ;
112+ Self : ' a ,
113+ ' b : ' a ;
113114
114115 /// Execute the provided operations on the I2C bus as a single transaction.
115116 ///
@@ -124,11 +125,11 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
124125 /// - `SAD+R/W` = slave address followed by bit 1 to indicate reading or 0 to indicate writing
125126 /// - `SR` = repeated start condition
126127 /// - `SP` = stop condition
127- fn transaction < ' a > (
128+ fn transaction < ' a , ' b > (
128129 & ' a mut self ,
129130 address : A ,
130- operations : & mut [ Operation < ' a > ] ,
131- ) -> Self :: TransactionFuture < ' a > ;
131+ operations : & ' a mut [ Operation < ' b > ] ,
132+ ) -> Self :: TransactionFuture < ' a , ' b > ;
132133}
133134
134135impl < A : AddressMode , T : I2c < A > > I2c < A > for & mut T {
@@ -164,16 +165,17 @@ impl<A: AddressMode, T: I2c<A>> I2c<A> for &mut T {
164165 T :: write_read ( self , address, bytes, buffer)
165166 }
166167
167- type TransactionFuture < ' a >
168+ type TransactionFuture < ' a , ' b >
168169 where
169170 Self : ' a ,
170- = T :: TransactionFuture < ' a > ;
171+ ' b : ' a ,
172+ = T :: TransactionFuture < ' a , ' b > ;
171173
172- fn transaction < ' a > (
174+ fn transaction < ' a , ' b > (
173175 & ' a mut self ,
174176 address : A ,
175- operations : & mut [ Operation < ' a > ] ,
176- ) -> Self :: TransactionFuture < ' a > {
177+ operations : & ' a mut [ Operation < ' b > ] ,
178+ ) -> Self :: TransactionFuture < ' a , ' b > {
177179 T :: transaction ( self , address, operations)
178180 }
179181}
0 commit comments