Skip to content

Commit 545171e

Browse files
committed
chore: make clippy happy
1 parent 920665d commit 545171e

File tree

3 files changed

+22
-40
lines changed

3 files changed

+22
-40
lines changed

src/client.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,13 +1462,10 @@ impl<T: Read + Write + Unpin + fmt::Debug> Connection<T> {
14621462
"code: {:?}, info: {:?}",
14631463
code, information
14641464
))),
1465-
_ => Err(Error::Io(io::Error::new(
1466-
io::ErrorKind::Other,
1467-
format!(
1468-
"status: {:?}, code: {:?}, information: {:?}",
1469-
status, code, information
1470-
),
1471-
))),
1465+
_ => Err(Error::Io(io::Error::other(format!(
1466+
"status: {:?}, code: {:?}, information: {:?}",
1467+
status, code, information
1468+
)))),
14721469
}
14731470
}
14741471
}

src/imap_stream.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,11 @@ impl<R: Read + Write + Unpin> ImapStream<R> {
103103
}
104104
Err(other) => {
105105
self.decode_needs = 0;
106-
Err(Some(io::Error::new(
107-
io::ErrorKind::Other,
108-
format!(
109-
"{:?} during parsing of {:?}",
110-
other,
111-
String::from_utf8_lossy(buf)
112-
),
113-
)))
106+
Err(Some(io::Error::other(format!(
107+
"{:?} during parsing of {:?}",
108+
other,
109+
String::from_utf8_lossy(buf)
110+
))))
114111
}
115112
}
116113
});
@@ -204,10 +201,7 @@ impl Buffer {
204201
n => min_size + (Self::BLOCK_SIZE - n),
205202
};
206203
if new_size > Self::MAX_CAPACITY {
207-
Err(io::Error::new(
208-
io::ErrorKind::Other,
209-
"incoming data too large",
210-
))
204+
Err(io::Error::other("incoming data too large"))
211205
} else {
212206
self.block.resize(new_size, 0);
213207
Ok(())

src/parse.rs

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,10 @@ pub(crate) async fn parse_status<T: Stream<Item = io::Result<ResponseData>> + Un
127127
)))
128128
}
129129
_ => {
130-
return Err(Error::Io(io::Error::new(
131-
io::ErrorKind::Other,
132-
format!(
133-
"status: {:?}, code: {:?}, information: {:?}",
134-
status, code, information
135-
),
136-
)));
130+
return Err(Error::Io(io::Error::other(format!(
131+
"status: {:?}, code: {:?}, information: {:?}",
132+
status, code, information
133+
))));
137134
}
138135
}
139136
}
@@ -273,13 +270,10 @@ pub(crate) async fn parse_mailbox<T: Stream<Item = io::Result<ResponseData>> + U
273270
)))
274271
}
275272
_ => {
276-
return Err(Error::Io(io::Error::new(
277-
io::ErrorKind::Other,
278-
format!(
279-
"status: {:?}, code: {:?}, information: {:?}",
280-
status, code, information
281-
),
282-
)));
273+
return Err(Error::Io(io::Error::other(format!(
274+
"status: {:?}, code: {:?}, information: {:?}",
275+
status, code, information
276+
))));
283277
}
284278
}
285279
}
@@ -327,13 +321,10 @@ pub(crate) async fn parse_mailbox<T: Stream<Item = io::Result<ResponseData>> + U
327321
)))
328322
}
329323
_ => {
330-
return Err(Error::Io(io::Error::new(
331-
io::ErrorKind::Other,
332-
format!(
333-
"status: {:?}, code: {:?}, information: {:?}",
334-
status, code, information
335-
),
336-
)));
324+
return Err(Error::Io(io::Error::other(format!(
325+
"status: {:?}, code: {:?}, information: {:?}",
326+
status, code, information
327+
))));
337328
}
338329
}
339330
}

0 commit comments

Comments
 (0)