Skip to content

async: update to new location of where clause. #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: nightly
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
Expand Down
10 changes: 2 additions & 8 deletions embedded-hal-async/src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,13 @@ where
{
type Error = T::Error;

type DelayUsFuture<'a>
where
Self: 'a,
= T::DelayUsFuture<'a>;
type DelayUsFuture<'a> = T::DelayUsFuture<'a> where Self: 'a;

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

type DelayMsFuture<'a>
where
Self: 'a,
= T::DelayMsFuture<'a>;
type DelayMsFuture<'a> = T::DelayMsFuture<'a> where Self: 'a;

fn delay_ms(&mut self, ms: u32) -> Self::DelayMsFuture<'_> {
T::delay_ms(self, ms)
Expand Down
21 changes: 4 additions & 17 deletions embedded-hal-async/src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,28 +133,19 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
}

impl<A: AddressMode, T: I2c<A>> I2c<A> for &mut T {
type ReadFuture<'a>
where
Self: 'a,
= T::ReadFuture<'a>;
type ReadFuture<'a> = T::ReadFuture<'a> where Self: 'a;

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

type WriteFuture<'a>
where
Self: 'a,
= T::WriteFuture<'a>;
type WriteFuture<'a> = T::WriteFuture<'a> where Self: 'a;

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

type WriteReadFuture<'a>
where
Self: 'a,
= T::WriteReadFuture<'a>;
type WriteReadFuture<'a> = T::WriteReadFuture<'a> where Self: 'a;

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

type TransactionFuture<'a, 'b>
where
Self: 'a,
'b: 'a,
= T::TransactionFuture<'a, 'b>;
type TransactionFuture<'a, 'b> = T::TransactionFuture<'a, 'b> where Self: 'a, 'b: 'a;

fn transaction<'a, 'b>(
&'a mut self,
Expand Down