Skip to content

Commit

Permalink
A few minor clippy nits
Browse files Browse the repository at this point in the history
* semicolons
* doc links
* unused Error namespace
  • Loading branch information
nyurik committed Nov 22, 2023
1 parent 6df95fd commit 2e1d78f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
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

0 comments on commit 2e1d78f

Please sign in to comment.