Skip to content
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

A few minor clippy nits #530

Merged
merged 1 commit into from
Nov 25, 2023
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
4 changes: 2 additions & 2 deletions embedded-hal-bus/src/spi/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ pub struct MutexDevice<'a, BUS, CS, D> {
}

impl<'a, BUS, CS, D> MutexDevice<'a, BUS, CS, D> {
/// Create a new MutexDevice.
/// Create a new [`MutexDevice`].
#[inline]
pub fn new(bus: &'a Mutex<BUS>, cs: CS, delay: D) -> Self {
Self { bus, cs, delay }
}
}

impl<'a, BUS, CS> MutexDevice<'a, BUS, CS, super::NoDelay> {
/// Create a new MutexDevice without support for in-transaction delays.
/// Create a new [`MutexDevice`] without support for in-transaction delays.
///
/// # Panics
///
Expand Down
2 changes: 1 addition & 1 deletion embedded-io-adapters/src/futures_03.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<T: futures::io::AsyncBufRead + Unpin + ?Sized> embedded_io_async::BufRead f
}

fn consume(&mut self, amt: usize) {
Pin::new(&mut self.inner).consume(amt)
Pin::new(&mut self.inner).consume(amt);
}
}

Expand Down
6 changes: 3 additions & 3 deletions embedded-io-adapters/src/std.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Adapters to/from `std::io` traits.

use embedded_io::Error;
use embedded_io::Error as _;

/// Adapter from `std::io` traits.
#[derive(Clone)]
Expand Down Expand Up @@ -48,7 +48,7 @@ impl<T: std::io::BufRead + ?Sized> embedded_io::BufRead for FromStd<T> {
}

fn consume(&mut self, amt: usize) {
self.inner.consume(amt)
self.inner.consume(amt);
}
}

Expand Down Expand Up @@ -126,7 +126,7 @@ impl<T: embedded_io::Seek + ?Sized> std::io::Seek for ToStd<T> {
}
}

/// Convert a embedded-io error to a std::io::Error
/// Convert a embedded-io error to a [`std::io::Error`]
pub fn to_std_error<T: embedded_io::Error>(err: T) -> std::io::Error {
std::io::Error::new(err.kind().into(), format!("{err:?}"))
}
2 changes: 1 addition & 1 deletion embedded-io-adapters/src/tokio_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<T: tokio::io::AsyncBufRead + Unpin + ?Sized> embedded_io_async::BufRead for
}

fn consume(&mut self, amt: usize) {
Pin::new(&mut self.inner).consume(amt)
Pin::new(&mut self.inner).consume(amt);
}
}

Expand Down
2 changes: 1 addition & 1 deletion embedded-io-async/src/impls/boxx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl<T: ?Sized + BufRead> BufRead for Box<T> {

#[inline]
fn consume(&mut self, amt: usize) {
T::consume(self, amt)
T::consume(self, amt);
}
}

Expand Down
2 changes: 1 addition & 1 deletion embedded-io/src/impls/boxx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<T: ?Sized + BufRead> BufRead for Box<T> {
}

fn consume(&mut self, amt: usize) {
T::consume(self, amt)
T::consume(self, amt);
}
}

Expand Down