Skip to content

Commit 2b72166

Browse files
committed
io: make clippy happy
1 parent 202c88c commit 2b72166

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

embedded-io-adapters/src/std.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
//! Adapters to/from `std::io` traits.
22
3-
#![deny(
4-
clippy::missing_trait_methods,
5-
reason = "Methods should be forwarded to the underlying type"
6-
)]
7-
83
use embedded_io::Error as _;
94

105
/// Adapter from `std::io` traits.
@@ -41,6 +36,10 @@ impl<T: ?Sized> embedded_io::ErrorType for FromStd<T> {
4136
type Error = std::io::Error;
4237
}
4338

39+
#[deny(
40+
clippy::missing_trait_methods,
41+
reason = "Methods should be forwarded to the underlying type"
42+
)]
4443
impl<T: std::io::Read + ?Sized> embedded_io::Read for FromStd<T> {
4544
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
4645
self.inner.read(buf)
@@ -60,6 +59,10 @@ impl<T: std::io::Read + ?Sized> embedded_io::Read for FromStd<T> {
6059
}
6160
}
6261

62+
#[deny(
63+
clippy::missing_trait_methods,
64+
reason = "Methods should be forwarded to the underlying type"
65+
)]
6366
impl<T: std::io::BufRead + ?Sized> embedded_io::BufRead for FromStd<T> {
6467
fn fill_buf(&mut self) -> Result<&[u8], Self::Error> {
6568
self.inner.fill_buf()
@@ -70,6 +73,10 @@ impl<T: std::io::BufRead + ?Sized> embedded_io::BufRead for FromStd<T> {
7073
}
7174
}
7275

76+
#[deny(
77+
clippy::missing_trait_methods,
78+
reason = "Methods should be forwarded to the underlying type"
79+
)]
7380
impl<T: std::io::Write + ?Sized> embedded_io::Write for FromStd<T> {
7481
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
7582
match self.inner.write(buf) {
@@ -95,6 +102,10 @@ impl<T: std::io::Write + ?Sized> embedded_io::Write for FromStd<T> {
95102
}
96103
}
97104

105+
#[deny(
106+
clippy::missing_trait_methods,
107+
reason = "Methods should be forwarded to the underlying type"
108+
)]
98109
impl<T: std::io::Seek + ?Sized> embedded_io::Seek for FromStd<T> {
99110
fn seek(&mut self, pos: embedded_io::SeekFrom) -> Result<u64, Self::Error> {
100111
self.inner.seek(pos.into())

embedded-io/src/impls/boxx.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ impl<T: ?Sized + Read> Read for Box<T> {
2626

2727
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))]
2828
impl<T: ?Sized + BufRead> BufRead for Box<T> {
29+
#[inline]
2930
fn fill_buf(&mut self) -> Result<&[u8], Self::Error> {
3031
T::fill_buf(self)
3132
}

0 commit comments

Comments
 (0)