Skip to content

Commit 0fdb7be

Browse files
committed
Remove useless map_err()
1 parent a737d63 commit 0fdb7be

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/client/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl Reader for Context {
130130
.call(Request::ReadCoils(addr, cnt))
131131
.await
132132
.map(|result| {
133-
result.map_err(Into::into).map(|response| match response {
133+
result.map(|response| match response {
134134
Response::ReadCoils(mut coils) => {
135135
debug_assert!(coils.len() >= cnt.into());
136136
coils.truncate(cnt.into());
@@ -150,7 +150,7 @@ impl Reader for Context {
150150
.call(Request::ReadDiscreteInputs(addr, cnt))
151151
.await
152152
.map(|result| {
153-
result.map_err(Into::into).map(|response| match response {
153+
result.map(|response| match response {
154154
Response::ReadDiscreteInputs(mut coils) => {
155155
debug_assert!(coils.len() >= cnt.into());
156156
coils.truncate(cnt.into());
@@ -170,7 +170,7 @@ impl Reader for Context {
170170
.call(Request::ReadInputRegisters(addr, cnt))
171171
.await
172172
.map(|result| {
173-
result.map_err(Into::into).map(|response| match response {
173+
result.map(|response| match response {
174174
Response::ReadInputRegisters(words) => {
175175
debug_assert_eq!(words.len(), cnt.into());
176176
words
@@ -189,7 +189,7 @@ impl Reader for Context {
189189
.call(Request::ReadHoldingRegisters(addr, cnt))
190190
.await
191191
.map(|result| {
192-
result.map_err(Into::into).map(|response| match response {
192+
result.map(|response| match response {
193193
Response::ReadHoldingRegisters(words) => {
194194
debug_assert_eq!(words.len(), cnt.into());
195195
words
@@ -215,7 +215,7 @@ impl Reader for Context {
215215
))
216216
.await
217217
.map(|result| {
218-
result.map_err(Into::into).map(|response| match response {
218+
result.map(|response| match response {
219219
Response::ReadWriteMultipleRegisters(words) => {
220220
debug_assert_eq!(words.len(), read_count.into());
221221
words
@@ -233,7 +233,7 @@ impl Writer for Context {
233233
.call(Request::WriteSingleCoil(addr, coil))
234234
.await
235235
.map(|result| {
236-
result.map_err(Into::into).map(|response| match response {
236+
result.map(|response| match response {
237237
Response::WriteSingleCoil(rsp_addr, rsp_coil) => {
238238
debug_assert_eq!(addr, rsp_addr);
239239
debug_assert_eq!(coil, rsp_coil);
@@ -249,7 +249,7 @@ impl Writer for Context {
249249
.call(Request::WriteMultipleCoils(addr, Cow::Borrowed(coils)))
250250
.await
251251
.map(|result| {
252-
result.map_err(Into::into).map(|response| match response {
252+
result.map(|response| match response {
253253
Response::WriteMultipleCoils(rsp_addr, rsp_cnt) => {
254254
debug_assert_eq!(addr, rsp_addr);
255255
debug_assert_eq!(cnt, rsp_cnt.into());
@@ -264,7 +264,7 @@ impl Writer for Context {
264264
.call(Request::WriteSingleRegister(addr, word))
265265
.await
266266
.map(|result| {
267-
result.map_err(Into::into).map(|response| match response {
267+
result.map(|response| match response {
268268
Response::WriteSingleRegister(rsp_addr, rsp_word) => {
269269
debug_assert_eq!(addr, rsp_addr);
270270
debug_assert_eq!(word, rsp_word);
@@ -284,7 +284,7 @@ impl Writer for Context {
284284
.call(Request::WriteMultipleRegisters(addr, Cow::Borrowed(data)))
285285
.await
286286
.map(|result| {
287-
result.map_err(Into::into).map(|response| match response {
287+
result.map(|response| match response {
288288
Response::WriteMultipleRegisters(rsp_addr, rsp_cnt) => {
289289
debug_assert_eq!(addr, rsp_addr);
290290
debug_assert_eq!(cnt, rsp_cnt.into());
@@ -304,7 +304,7 @@ impl Writer for Context {
304304
.call(Request::MaskWriteRegister(addr, and_mask, or_mask))
305305
.await
306306
.map(|result| {
307-
result.map_err(Into::into).map(|response| match response {
307+
result.map(|response| match response {
308308
Response::MaskWriteRegister(rsp_addr, rsp_and_mask, rsp_or_mask) => {
309309
debug_assert_eq!(addr, rsp_addr);
310310
debug_assert_eq!(and_mask, rsp_and_mask);

0 commit comments

Comments
 (0)