Skip to content

Commit c80e9d9

Browse files
bors[bot]Dirbaio
andauthored
Merge #371
371: async: update to new location of where clause. r=eldruin a=Dirbaio Latest nightly changed the location of the `where` clause on impls with GATs: rust-lang/rust#89122 Co-authored-by: Dario Nieuwenhuis <[email protected]>
2 parents 2e2ac6e + cdd6f28 commit c80e9d9

File tree

3 files changed

+7
-26
lines changed

3 files changed

+7
-26
lines changed

.github/workflows/rustfmt.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions-rs/toolchain@v1
1414
with:
1515
profile: minimal
16-
toolchain: stable
16+
toolchain: nightly
1717
override: true
1818
components: rustfmt
1919
- uses: actions-rs/cargo@v1

embedded-hal-async/src/delay.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,13 @@ where
3232
{
3333
type Error = T::Error;
3434

35-
type DelayUsFuture<'a>
36-
where
37-
Self: 'a,
38-
= T::DelayUsFuture<'a>;
35+
type DelayUsFuture<'a> = T::DelayUsFuture<'a> where Self: 'a;
3936

4037
fn delay_us(&mut self, us: u32) -> Self::DelayUsFuture<'_> {
4138
T::delay_us(self, us)
4239
}
4340

44-
type DelayMsFuture<'a>
45-
where
46-
Self: 'a,
47-
= T::DelayMsFuture<'a>;
41+
type DelayMsFuture<'a> = T::DelayMsFuture<'a> where Self: 'a;
4842

4943
fn delay_ms(&mut self, ms: u32) -> Self::DelayMsFuture<'_> {
5044
T::delay_ms(self, ms)

embedded-hal-async/src/i2c.rs

+4-17
Original file line numberDiff line numberDiff line change
@@ -133,28 +133,19 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
133133
}
134134

135135
impl<A: AddressMode, T: I2c<A>> I2c<A> for &mut T {
136-
type ReadFuture<'a>
137-
where
138-
Self: 'a,
139-
= T::ReadFuture<'a>;
136+
type ReadFuture<'a> = T::ReadFuture<'a> where Self: 'a;
140137

141138
fn read<'a>(&'a mut self, address: A, buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
142139
T::read(self, address, buffer)
143140
}
144141

145-
type WriteFuture<'a>
146-
where
147-
Self: 'a,
148-
= T::WriteFuture<'a>;
142+
type WriteFuture<'a> = T::WriteFuture<'a> where Self: 'a;
149143

150144
fn write<'a>(&'a mut self, address: A, bytes: &'a [u8]) -> Self::WriteFuture<'a> {
151145
T::write(self, address, bytes)
152146
}
153147

154-
type WriteReadFuture<'a>
155-
where
156-
Self: 'a,
157-
= T::WriteReadFuture<'a>;
148+
type WriteReadFuture<'a> = T::WriteReadFuture<'a> where Self: 'a;
158149

159150
fn write_read<'a>(
160151
&'a mut self,
@@ -165,11 +156,7 @@ impl<A: AddressMode, T: I2c<A>> I2c<A> for &mut T {
165156
T::write_read(self, address, bytes, buffer)
166157
}
167158

168-
type TransactionFuture<'a, 'b>
169-
where
170-
Self: 'a,
171-
'b: 'a,
172-
= T::TransactionFuture<'a, 'b>;
159+
type TransactionFuture<'a, 'b> = T::TransactionFuture<'a, 'b> where Self: 'a, 'b: 'a;
173160

174161
fn transaction<'a, 'b>(
175162
&'a mut self,

0 commit comments

Comments
 (0)