1
1
//! Adapters to/from `std::io` traits.
2
2
3
- #![ deny(
4
- clippy:: missing_trait_methods,
5
- reason = "Methods should be forwarded to the underlying type"
6
- ) ]
7
-
8
3
use embedded_io:: Error as _;
9
4
10
5
/// Adapter from `std::io` traits.
@@ -41,6 +36,10 @@ impl<T: ?Sized> embedded_io::ErrorType for FromStd<T> {
41
36
type Error = std:: io:: Error ;
42
37
}
43
38
39
+ #[ deny(
40
+ clippy:: missing_trait_methods,
41
+ reason = "Methods should be forwarded to the underlying type"
42
+ ) ]
44
43
impl < T : std:: io:: Read + ?Sized > embedded_io:: Read for FromStd < T > {
45
44
fn read ( & mut self , buf : & mut [ u8 ] ) -> Result < usize , Self :: Error > {
46
45
self . inner . read ( buf)
@@ -60,6 +59,10 @@ impl<T: std::io::Read + ?Sized> embedded_io::Read for FromStd<T> {
60
59
}
61
60
}
62
61
62
+ #[ deny(
63
+ clippy:: missing_trait_methods,
64
+ reason = "Methods should be forwarded to the underlying type"
65
+ ) ]
63
66
impl < T : std:: io:: BufRead + ?Sized > embedded_io:: BufRead for FromStd < T > {
64
67
fn fill_buf ( & mut self ) -> Result < & [ u8 ] , Self :: Error > {
65
68
self . inner . fill_buf ( )
@@ -70,6 +73,10 @@ impl<T: std::io::BufRead + ?Sized> embedded_io::BufRead for FromStd<T> {
70
73
}
71
74
}
72
75
76
+ #[ deny(
77
+ clippy:: missing_trait_methods,
78
+ reason = "Methods should be forwarded to the underlying type"
79
+ ) ]
73
80
impl < T : std:: io:: Write + ?Sized > embedded_io:: Write for FromStd < T > {
74
81
fn write ( & mut self , buf : & [ u8 ] ) -> Result < usize , Self :: Error > {
75
82
match self . inner . write ( buf) {
@@ -95,6 +102,10 @@ impl<T: std::io::Write + ?Sized> embedded_io::Write for FromStd<T> {
95
102
}
96
103
}
97
104
105
+ #[ deny(
106
+ clippy:: missing_trait_methods,
107
+ reason = "Methods should be forwarded to the underlying type"
108
+ ) ]
98
109
impl < T : std:: io:: Seek + ?Sized > embedded_io:: Seek for FromStd < T > {
99
110
fn seek ( & mut self , pos : embedded_io:: SeekFrom ) -> Result < u64 , Self :: Error > {
100
111
self . inner . seek ( pos. into ( ) )
0 commit comments