Skip to content

Commit 0600602

Browse files
devworldsplebhash
devworlds
authored andcommitted
feat: cargo clippy warning solved
1 parent 2cd6e4c commit 0600602

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

roles/jd-client/src/lib/error.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub enum Error<'a> {
6161
Infallible(std::convert::Infallible),
6262
}
6363

64-
impl<'a> fmt::Display for Error<'a> {
64+
impl fmt::Display for Error<'_> {
6565
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6666
use Error::*;
6767
match self {
@@ -86,55 +86,55 @@ impl<'a> fmt::Display for Error<'a> {
8686
}
8787
}
8888

89-
impl<'a> From<binary_sv2::Error> for Error<'a> {
89+
impl From<binary_sv2::Error> for Error<'_> {
9090
fn from(e: binary_sv2::Error) -> Self {
9191
Error::BinarySv2(e)
9292
}
9393
}
9494

95-
impl<'a> From<codec_sv2::noise_sv2::Error> for Error<'a> {
95+
impl From<codec_sv2::noise_sv2::Error> for Error<'_> {
9696
fn from(e: codec_sv2::noise_sv2::Error) -> Self {
9797
Error::CodecNoise(e)
9898
}
9999
}
100100

101-
impl<'a> From<framing_sv2::Error> for Error<'a> {
101+
impl From<framing_sv2::Error> for Error<'_> {
102102
fn from(e: framing_sv2::Error) -> Self {
103103
Error::FramingSv2(e)
104104
}
105105
}
106106

107-
impl<'a> From<std::io::Error> for Error<'a> {
107+
impl From<std::io::Error> for Error<'_> {
108108
fn from(e: std::io::Error) -> Self {
109109
Error::Io(e)
110110
}
111111
}
112112

113-
impl<'a> From<std::num::ParseIntError> for Error<'a> {
113+
impl From<std::num::ParseIntError> for Error<'_> {
114114
fn from(e: std::num::ParseIntError) -> Self {
115115
Error::ParseInt(e)
116116
}
117117
}
118118

119-
impl<'a> From<roles_logic_sv2::errors::Error> for Error<'a> {
119+
impl From<roles_logic_sv2::errors::Error> for Error<'_> {
120120
fn from(e: roles_logic_sv2::errors::Error) -> Self {
121121
Error::RolesSv2Logic(e)
122122
}
123123
}
124124

125-
impl<'a> From<ConfigError> for Error<'a> {
125+
impl From<ConfigError> for Error<'_> {
126126
fn from(e: ConfigError) -> Self {
127127
Error::BadConfigDeserialize(e)
128128
}
129129
}
130130

131-
impl<'a> From<async_channel::RecvError> for Error<'a> {
131+
impl From<async_channel::RecvError> for Error<'_> {
132132
fn from(e: async_channel::RecvError) -> Self {
133133
Error::ChannelErrorReceiver(e)
134134
}
135135
}
136136

137-
impl<'a> From<tokio::sync::broadcast::error::RecvError> for Error<'a> {
137+
impl From<tokio::sync::broadcast::error::RecvError> for Error<'_> {
138138
fn from(e: tokio::sync::broadcast::error::RecvError) -> Self {
139139
Error::TokioChannelErrorRecv(e)
140140
}
@@ -176,7 +176,7 @@ impl<'a> From<async_channel::SendError<roles_logic_sv2::mining_sv2::SetNewPrevHa
176176
}
177177
}
178178

179-
impl<'a> From<async_channel::SendError<(ExtendedExtranonce, u32)>> for Error<'a> {
179+
impl From<async_channel::SendError<(ExtendedExtranonce, u32)>> for Error<'_> {
180180
fn from(e: async_channel::SendError<(ExtendedExtranonce, u32)>) -> Self {
181181
Error::ChannelErrorSender(ChannelSendError::Extranonce(e))
182182
}
@@ -212,13 +212,13 @@ impl<'a>
212212
}
213213
}
214214

215-
impl<'a> From<ParseLengthError> for Error<'a> {
215+
impl From<ParseLengthError> for Error<'_> {
216216
fn from(e: ParseLengthError) -> Self {
217217
Error::Uint256Conversion(e)
218218
}
219219
}
220220

221-
impl<'a> From<std::convert::Infallible> for Error<'a> {
221+
impl From<std::convert::Infallible> for Error<'_> {
222222
fn from(e: std::convert::Infallible) -> Self {
223223
Error::Infallible(e)
224224
}

roles/jd-client/src/lib/job_declarator/message_handler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl ParseServerJobDeclarationMessages for JobDeclarator {
6767
None
6868
}
6969
})
70-
.ok_or_else(|| Error::UnknownRequestId(message.request_id))?;
70+
.ok_or(Error::UnknownRequestId(message.request_id))?;
7171

7272
let unknown_tx_position_list: Vec<u16> = message.unknown_tx_position_list.into_inner();
7373
let missing_transactions: Vec<binary_sv2::B016M> = unknown_tx_position_list

roles/translator/src/lib/error.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub enum Error<'a> {
7878
Sv1MessageTooLong,
7979
}
8080

81-
impl<'a> fmt::Display for Error<'a> {
81+
impl fmt::Display for Error<'_> {
8282
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8383
use Error::*;
8484
match self {
@@ -118,49 +118,49 @@ impl<'a> fmt::Display for Error<'a> {
118118
}
119119
}
120120

121-
impl<'a> From<binary_sv2::Error> for Error<'a> {
121+
impl From<binary_sv2::Error> for Error<'_> {
122122
fn from(e: binary_sv2::Error) -> Self {
123123
Error::BinarySv2(e)
124124
}
125125
}
126126

127-
impl<'a> From<codec_sv2::noise_sv2::Error> for Error<'a> {
127+
impl From<codec_sv2::noise_sv2::Error> for Error<'_> {
128128
fn from(e: codec_sv2::noise_sv2::Error) -> Self {
129129
Error::CodecNoise(e)
130130
}
131131
}
132132

133-
impl<'a> From<framing_sv2::Error> for Error<'a> {
133+
impl From<framing_sv2::Error> for Error<'_> {
134134
fn from(e: framing_sv2::Error) -> Self {
135135
Error::FramingSv2(e)
136136
}
137137
}
138138

139-
impl<'a> From<std::io::Error> for Error<'a> {
139+
impl From<std::io::Error> for Error<'_> {
140140
fn from(e: std::io::Error) -> Self {
141141
Error::Io(e)
142142
}
143143
}
144144

145-
impl<'a> From<std::num::ParseIntError> for Error<'a> {
145+
impl From<std::num::ParseIntError> for Error<'_> {
146146
fn from(e: std::num::ParseIntError) -> Self {
147147
Error::ParseInt(e)
148148
}
149149
}
150150

151-
impl<'a> From<roles_logic_sv2::errors::Error> for Error<'a> {
151+
impl From<roles_logic_sv2::errors::Error> for Error<'_> {
152152
fn from(e: roles_logic_sv2::errors::Error) -> Self {
153153
Error::RolesSv2Logic(e)
154154
}
155155
}
156156

157-
impl<'a> From<serde_json::Error> for Error<'a> {
157+
impl From<serde_json::Error> for Error<'_> {
158158
fn from(e: serde_json::Error) -> Self {
159159
Error::BadSerdeJson(e)
160160
}
161161
}
162162

163-
impl<'a> From<ConfigError> for Error<'a> {
163+
impl From<ConfigError> for Error<'_> {
164164
fn from(e: ConfigError) -> Self {
165165
Error::BadConfigDeserialize(e)
166166
}
@@ -172,20 +172,20 @@ impl<'a> From<v1::error::Error<'a>> for Error<'a> {
172172
}
173173
}
174174

175-
impl<'a> From<async_channel::RecvError> for Error<'a> {
175+
impl From<async_channel::RecvError> for Error<'_> {
176176
fn from(e: async_channel::RecvError) -> Self {
177177
Error::ChannelErrorReceiver(e)
178178
}
179179
}
180180

181-
impl<'a> From<tokio::sync::broadcast::error::RecvError> for Error<'a> {
181+
impl From<tokio::sync::broadcast::error::RecvError> for Error<'_> {
182182
fn from(e: tokio::sync::broadcast::error::RecvError) -> Self {
183183
Error::TokioChannelErrorRecv(e)
184184
}
185185
}
186186

187187
//*** LOCK ERRORS ***
188-
impl<'a, T> From<PoisonError<T>> for Error<'a> {
188+
impl<T> From<PoisonError<T>> for Error<'_> {
189189
fn from(_e: PoisonError<T>) -> Self {
190190
Error::PoisonLock
191191
}
@@ -216,13 +216,13 @@ impl<'a> From<tokio::sync::broadcast::error::SendError<Notify<'a>>> for Error<'a
216216
}
217217
}
218218

219-
impl<'a> From<async_channel::SendError<v1::Message>> for Error<'a> {
219+
impl From<async_channel::SendError<v1::Message>> for Error<'_> {
220220
fn from(e: async_channel::SendError<v1::Message>) -> Self {
221221
Error::ChannelErrorSender(ChannelSendError::V1Message(e))
222222
}
223223
}
224224

225-
impl<'a> From<async_channel::SendError<(ExtendedExtranonce, u32)>> for Error<'a> {
225+
impl From<async_channel::SendError<(ExtendedExtranonce, u32)>> for Error<'_> {
226226
fn from(e: async_channel::SendError<(ExtendedExtranonce, u32)>) -> Self {
227227
Error::ChannelErrorSender(ChannelSendError::Extranonce(e))
228228
}
@@ -258,25 +258,25 @@ impl<'a>
258258
}
259259
}
260260

261-
impl<'a> From<Vec<u8>> for Error<'a> {
261+
impl From<Vec<u8>> for Error<'_> {
262262
fn from(e: Vec<u8>) -> Self {
263263
Error::VecToSlice32(e)
264264
}
265265
}
266266

267-
impl<'a> From<ParseLengthError> for Error<'a> {
267+
impl From<ParseLengthError> for Error<'_> {
268268
fn from(e: ParseLengthError) -> Self {
269269
Error::Uint256Conversion(e)
270270
}
271271
}
272272

273-
impl<'a> From<SetDifficulty> for Error<'a> {
273+
impl From<SetDifficulty> for Error<'_> {
274274
fn from(e: SetDifficulty) -> Self {
275275
Error::SetDifficultyToMessage(e)
276276
}
277277
}
278278

279-
impl<'a> From<std::convert::Infallible> for Error<'a> {
279+
impl From<std::convert::Infallible> for Error<'_> {
280280
fn from(e: std::convert::Infallible) -> Self {
281281
Error::Infallible(e)
282282
}

0 commit comments

Comments
 (0)