Skip to content

Commit 52b268d

Browse files
authored
fix(ci): reduce clippy warnings (#382)
1 parent e3ffebd commit 52b268d

File tree

8 files changed

+11
-14
lines changed

8 files changed

+11
-14
lines changed

compio-buf/src/io_vec_buf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::ops::{Deref, DerefMut};
22

33
use crate::{
4-
t_alloc, IndexedIter, IoBuf, IoBufMut, IoSlice, IoSliceMut, OwnedIterator, SetBufInit,
4+
IndexedIter, IoBuf, IoBufMut, IoSlice, IoSliceMut, OwnedIterator, SetBufInit, t_alloc,
55
};
66

77
/// A type that's either owned or borrowed. Like [`Cow`](std::rc::Cow) but

compio-dispatcher/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ impl Dispatcher {
203203
}) {
204204
std::thread::spawn(f.0);
205205
}
206-
let results = rx.await.map_err(|_| {
207-
io::Error::new(io::ErrorKind::Other, "the join task cancelled unexpectedly")
208-
})?;
206+
let results = rx
207+
.await
208+
.map_err(|_| io::Error::other("the join task cancelled unexpectedly"))?;
209209
for res in results {
210210
res.unwrap_or_else(|e| resume_unwind(e));
211211
}

compio-fs/src/utils/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ impl DirBuilder {
135135
match path.parent() {
136136
Some(p) => Box::pin(self.create_dir_all(p)).await?,
137137
None => {
138-
return Err(io::Error::new(
139-
io::ErrorKind::Other,
140-
"failed to create whole tree",
141-
));
138+
return Err(io::Error::other("failed to create whole tree"));
142139
}
143140
}
144141
match self.inner.create(path).await {

compio-quic/src/endpoint.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ impl EndpointInner {
239239
self.respond(resp_buf, transmit);
240240
}
241241

242+
#[allow(clippy::result_large_err)]
242243
pub(crate) fn retry(
243244
&self,
244245
incoming: quinn_proto::Incoming,

compio-quic/src/incoming.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl Incoming {
5858
/// address validation.
5959
///
6060
/// Errors if `remote_address_validated()` is true.
61+
#[allow(clippy::result_large_err)]
6162
pub fn retry(mut self) -> Result<(), RetryError> {
6263
let inner = self.0.take().unwrap();
6364
inner

compio-tls/src/adapter/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async fn handshake_native_tls<S: AsyncRead + AsyncWrite>(
129129
return Ok(TlsStream::from(s));
130130
}
131131
Err(e) => match e {
132-
HandshakeError::Failure(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
132+
HandshakeError::Failure(e) => return Err(io::Error::other(e)),
133133
HandshakeError::WouldBlock(mut mid_stream) => {
134134
if mid_stream.get_mut().flush_write_buf().await? == 0 {
135135
mid_stream.get_mut().fill_read_buf().await?;
@@ -157,7 +157,7 @@ where
157157
return Ok(s);
158158
}
159159
Err(e) => match e {
160-
HandshakeError::Rustls(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
160+
HandshakeError::Rustls(e) => return Err(io::Error::other(e)),
161161
HandshakeError::System(e) => return Err(e),
162162
HandshakeError::WouldBlock(mut mid_stream) => {
163163
if mid_stream.get_mut().flush_write_buf().await? == 0 {

compio-tls/src/adapter/rtls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl TlsConnector {
102102
let conn = ClientConnection::new(
103103
self.0.clone(),
104104
ServerName::try_from(domain)
105-
.map_err(|e| HandshakeError::System(io::Error::new(io::ErrorKind::Other, e)))?
105+
.map_err(|e| HandshakeError::System(io::Error::other(e)))?
106106
.to_owned(),
107107
)
108108
.map_err(HandshakeError::Rustls)?;

compio-tls/src/stream/rtls.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ impl<S: io::Read> TlsStream<S> {
9797
loop {
9898
while self.conn.wants_read() {
9999
self.conn.read_tls(&mut self.inner)?;
100-
self.conn
101-
.process_new_packets()
102-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
100+
self.conn.process_new_packets().map_err(io::Error::other)?;
103101
}
104102

105103
match f(self.conn.reader()) {

0 commit comments

Comments
 (0)