From 5ab7ecd82e4616ce9a7bb8998e2998d1284b536e Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:13:12 +1000 Subject: [PATCH 01/29] Fix clippy error in brotli decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/brotli/decoder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codec/brotli/decoder.rs b/src/codec/brotli/decoder.rs index be115b1..56125b6 100644 --- a/src/codec/brotli/decoder.rs +++ b/src/codec/brotli/decoder.rs @@ -41,7 +41,7 @@ impl BrotliDecoder { &mut self.state, ) { BrotliResult::ResultFailure => { - return Err(io::Error::new(io::ErrorKind::Other, "brotli error")) + return Err(io::Error::other("brotli error")) } status => status, }; From b8f73f692956986f4f9bb7d9493cc09261fd1ee9 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:14:02 +1000 Subject: [PATCH 02/29] Fix clippy error in brotli encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/brotli/encoder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codec/brotli/encoder.rs b/src/codec/brotli/encoder.rs index dc974e3..fe363f9 100644 --- a/src/codec/brotli/encoder.rs +++ b/src/codec/brotli/encoder.rs @@ -41,7 +41,7 @@ impl BrotliEncoder { &mut None, &mut |_, _, _, _| (), ) { - return Err(io::Error::new(io::ErrorKind::Other, "brotli error")); + return Err(io::Error::other("brotli error")); } input.advance(input_len); From 5c6b3c0ef46bc541422b51e3a90322ccde0d4773 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:15:17 +1000 Subject: [PATCH 03/29] Fix encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/bzip2/encoder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codec/bzip2/encoder.rs b/src/codec/bzip2/encoder.rs index f17bdbf..b3ac9aa 100644 --- a/src/codec/bzip2/encoder.rs +++ b/src/codec/bzip2/encoder.rs @@ -57,7 +57,7 @@ impl BzEncoder { let status = self .compress .compress(input.unwritten(), output.unwritten_mut(), action) - .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; + .map_err(|e| io::Error::other(e))?; input.advance((self.compress.total_in() - prior_in) as usize); output.advance((self.compress.total_out() - prior_out) as usize); @@ -90,7 +90,7 @@ impl Encode for BzEncoder { // There was insufficient memory in the input or output buffer to complete // the request, but otherwise everything went normally. - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")), + Status::MemNeeded => Err(io::Error::other("out of memory")), } } From 7e6da263ca75f180b88f9c60110690e3411cf16e Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:17:03 +1000 Subject: [PATCH 04/29] Fix clippy error in bzip2 decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/bzip2/decoder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codec/bzip2/decoder.rs b/src/codec/bzip2/decoder.rs index f392a17..ab4e16f 100644 --- a/src/codec/bzip2/decoder.rs +++ b/src/codec/bzip2/decoder.rs @@ -36,7 +36,7 @@ impl BzDecoder { let status = self .decompress .decompress(input.unwritten(), output.unwritten_mut()) - .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; + .map_err(|e| io::Error::other(e))?; input.advance((self.decompress.total_in() - prior_in) as usize); output.advance((self.decompress.total_out() - prior_out) as usize); @@ -74,7 +74,7 @@ impl Decode for BzDecoder { // There was insufficient memory in the input or output buffer to complete // the request, but otherwise everything went normally. - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")), + Status::MemNeeded => Err(io::Error::other("out of memory")), } } From abdacc97e978ac95648c87de730629c0d13801ac Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:19:39 +1000 Subject: [PATCH 05/29] Fix clippy error in flate decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/flate/decoder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codec/flate/decoder.rs b/src/codec/flate/decoder.rs index 70c28c2..86fd139 100644 --- a/src/codec/flate/decoder.rs +++ b/src/codec/flate/decoder.rs @@ -51,7 +51,7 @@ impl Decode for FlateDecoder { match self.decode(input, output, FlushDecompress::None)? { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::BufError => Err(io::Error::new(io::ErrorKind::Other, "unexpected BufError")), + Status::BufError => Err(io::Error::other("unexpected BufError")), } } @@ -91,7 +91,7 @@ impl Decode for FlateDecoder { )? { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::BufError => Err(io::Error::new(io::ErrorKind::Other, "unexpected BufError")), + Status::BufError => Err(io::Error::other("unexpected BufError")), } } } From f4769ff9e63a88d7be658ac4ad2ec2b923810ab0 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:21:08 +1000 Subject: [PATCH 06/29] Fix clippy error in flate encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/flate/encoder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codec/flate/encoder.rs b/src/codec/flate/encoder.rs index 8665b0b..bcf6c02 100644 --- a/src/codec/flate/encoder.rs +++ b/src/codec/flate/encoder.rs @@ -51,7 +51,7 @@ impl Encode for FlateEncoder { match self.encode(input, output, FlushCompress::None)? { Status::Ok => Ok(()), Status::StreamEnd => unreachable!(), - Status::BufError => Err(io::Error::new(io::ErrorKind::Other, "unexpected BufError")), + Status::BufError => Err(io::Error::other("unexpected BufError")), } } @@ -100,7 +100,7 @@ impl Encode for FlateEncoder { )? { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::BufError => Err(io::Error::new(io::ErrorKind::Other, "unexpected BufError")), + Status::BufError => Err(io::Error::other("unexpected BufError")), } } } From b8b89bc5e34e6998b43a740187028c58e43824e7 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:22:37 +1000 Subject: [PATCH 07/29] Fix clippy error in gzip header.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/gzip/header.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/codec/gzip/header.rs b/src/codec/gzip/header.rs index 9faa638..ebe482a 100644 --- a/src/codec/gzip/header.rs +++ b/src/codec/gzip/header.rs @@ -156,10 +156,7 @@ impl Parser { } State::Done => { - return Err(io::Error::new( - io::ErrorKind::Other, - "parser used after done", - )); + return Err(io::Error::other("parser used after done")); } }; } From 88c171be76fa65599b9f5fe17994d254e5dfa7c5 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:23:29 +1000 Subject: [PATCH 08/29] Fix clippy error in gzip encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/gzip/encoder.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/codec/gzip/encoder.rs b/src/codec/gzip/encoder.rs index 5fcf35c..e6da04a 100644 --- a/src/codec/gzip/encoder.rs +++ b/src/codec/gzip/encoder.rs @@ -72,10 +72,7 @@ impl Encode for GzipEncoder { } State::Footer(_) | State::Done => { - return Err(io::Error::new( - io::ErrorKind::Other, - "encode after complete", - )); + return Err(io::Error::other("encode after complete")); } }; From 34105953986f30f0331c6fc41c6ba0003ce6f2b1 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:25:23 +1000 Subject: [PATCH 09/29] Fix clippy error in gzip decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/xz2/decoder.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/codec/xz2/decoder.rs b/src/codec/xz2/decoder.rs index cfcd1cb..3e83ea8 100644 --- a/src/codec/xz2/decoder.rs +++ b/src/codec/xz2/decoder.rs @@ -46,11 +46,10 @@ impl Decode for Xz2Decoder { match status { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::GetCheck => Err(io::Error::new( - io::ErrorKind::Other, - "Unexpected lzma integrity check", + Status::GetCheck => Err(io::Error::other( + "Unexpected lzma integrity check" )), - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "More memory needed")), + Status::MemNeeded => Err(io::Error::other("More memory needed")), } } From 12059f9a88ce73eea9aa7ad6d5afaac4d5acf3a0 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:26:23 +1000 Subject: [PATCH 10/29] Fix clippy error in gzip encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/xz2/encoder.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/codec/xz2/encoder.rs b/src/codec/xz2/encoder.rs index d31070a..081d227 100644 --- a/src/codec/xz2/encoder.rs +++ b/src/codec/xz2/encoder.rs @@ -48,11 +48,10 @@ impl Encode for Xz2Encoder { match status { Status::Ok | Status::StreamEnd => Ok(()), - Status::GetCheck => Err(io::Error::new( - io::ErrorKind::Other, - "Unexpected lzma integrity check", + Status::GetCheck => Err(io::Error::other( + "Unexpected lzma integrity check" )), - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")), + Status::MemNeeded => Err(io::Error::other("out of memory")), } } From dc239cb0a9962b16319baa659c0d7721e2263589 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:28:22 +1000 Subject: [PATCH 11/29] Fix clippy error in tokio generic decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/tokio/write/generic/decoder.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tokio/write/generic/decoder.rs b/src/tokio/write/generic/decoder.rs index d03dd30..d0ab145 100644 --- a/src/tokio/write/generic/decoder.rs +++ b/src/tokio/write/generic/decoder.rs @@ -88,8 +88,7 @@ impl Decoder { } State::Done => { - return Poll::Ready(Err(io::Error::new( - io::ErrorKind::Other, + return Poll::Ready(Err(io::Error::other( "Write after end of stream", ))) } From 4882199a0b58bd748fbcd0c7f87942223d23ff66 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:29:33 +1000 Subject: [PATCH 12/29] Fix clippy error in tokio generic encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/tokio/write/generic/encoder.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tokio/write/generic/encoder.rs b/src/tokio/write/generic/encoder.rs index 5f88ce3..ef36d23 100644 --- a/src/tokio/write/generic/encoder.rs +++ b/src/tokio/write/generic/encoder.rs @@ -96,8 +96,7 @@ impl Encoder { }, State::Finishing | State::Done => { - return Poll::Ready(Err(io::Error::new( - io::ErrorKind::Other, + return Poll::Ready(Err(io::Error::other( "Write after shutdown", ))) } @@ -123,8 +122,7 @@ impl Encoder { State::Encoding | State::Flushing => this.encoder.flush(&mut output)?, State::Finishing | State::Done => { - return Poll::Ready(Err(io::Error::new( - io::ErrorKind::Other, + return Poll::Ready(Err(io::Error::other( "Flush after shutdown", ))) } From c175b91caa46e88a95e6693c815ae33132e5c4fc Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:30:55 +1000 Subject: [PATCH 13/29] Fix clippy error in future write generic decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/futures/write/generic/decoder.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/futures/write/generic/decoder.rs b/src/futures/write/generic/decoder.rs index 0a00657..9288ac9 100644 --- a/src/futures/write/generic/decoder.rs +++ b/src/futures/write/generic/decoder.rs @@ -88,8 +88,7 @@ impl Decoder { } State::Done => { - return Poll::Ready(Err(io::Error::new( - io::ErrorKind::Other, + return Poll::Ready(Err(io::Error::other( "Write after end of stream", ))) } @@ -179,8 +178,7 @@ impl AsyncWrite for Decoder { ready!(self.as_mut().project().writer.as_mut().poll_close(cx))?; Poll::Ready(Ok(())) } else { - Poll::Ready(Err(io::Error::new( - io::ErrorKind::Other, + Poll::Ready(Err(io::Error::other( "Attempt to close before finishing input", ))) } From e4d68ef3da47aae2aaa86ef832b29935c3fcfee6 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:31:54 +1000 Subject: [PATCH 14/29] Fix clippy error in futures write generic encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/futures/write/generic/encoder.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/futures/write/generic/encoder.rs b/src/futures/write/generic/encoder.rs index 84f3bc4..17dc3ea 100644 --- a/src/futures/write/generic/encoder.rs +++ b/src/futures/write/generic/encoder.rs @@ -87,8 +87,7 @@ impl Encoder { } State::Finishing | State::Done => { - return Poll::Ready(Err(io::Error::new( - io::ErrorKind::Other, + return Poll::Ready(Err(io::Error::other( "Write after close", ))) } @@ -114,8 +113,7 @@ impl Encoder { State::Encoding => this.encoder.flush(&mut output)?, State::Finishing | State::Done => { - return Poll::Ready(Err(io::Error::new( - io::ErrorKind::Other, + return Poll::Ready(Err(io::Error::other( "Flush after close", ))) } From 9f16070b3746bb094612d287a5e6e2d28b16f08b Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:35:41 +1000 Subject: [PATCH 15/29] Fix doc link in lib.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 310ff62..37b98ee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,7 +32,7 @@ #![allow(unexpected_cfgs)] #![cfg_attr( feature = "futures-io", - doc = "[`futures-io`](crate::futures) | [`futures::io::AsyncBufRead`](futures_io::AsyncBufRead), [`futures::io::AsyncWrite`](futures_io::AsyncWrite)" + doc = "[`futures-io`] | [`futures::io::AsyncBufRead`](futures_io::AsyncBufRead), [`futures::io::AsyncWrite`](futures_io::AsyncWrite)" )] #![cfg_attr( not(feature = "futures-io"), @@ -40,7 +40,7 @@ )] #![cfg_attr( feature = "tokio", - doc = "[`tokio`](crate::tokio) | [`tokio::io::AsyncBufRead`](::tokio::io::AsyncBufRead), [`tokio::io::AsyncWrite`](::tokio::io::AsyncWrite)" + doc = "[`tokio`] | [`tokio::io::AsyncBufRead`](::tokio::io::AsyncBufRead), [`tokio::io::AsyncWrite`](::tokio::io::AsyncWrite)" )] #![cfg_attr( not(feature = "tokio"), From 381bf513246410548f9871279b6c5bc4e89c1734 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:52:03 +1000 Subject: [PATCH 16/29] Fix clippy error in bzip2 decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/bzip2/decoder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codec/bzip2/decoder.rs b/src/codec/bzip2/decoder.rs index ab4e16f..255169b 100644 --- a/src/codec/bzip2/decoder.rs +++ b/src/codec/bzip2/decoder.rs @@ -36,7 +36,7 @@ impl BzDecoder { let status = self .decompress .decompress(input.unwritten(), output.unwritten_mut()) - .map_err(|e| io::Error::other(e))?; + .map_err(io::Error::other)?; input.advance((self.decompress.total_in() - prior_in) as usize); output.advance((self.decompress.total_out() - prior_out) as usize); From c20c334d61f2e25852aac9d406f1b8b1df157e34 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:53:46 +1000 Subject: [PATCH 17/29] Fix clippy error in bzip2 encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/bzip2/encoder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codec/bzip2/encoder.rs b/src/codec/bzip2/encoder.rs index b3ac9aa..6f8f425 100644 --- a/src/codec/bzip2/encoder.rs +++ b/src/codec/bzip2/encoder.rs @@ -57,7 +57,7 @@ impl BzEncoder { let status = self .compress .compress(input.unwritten(), output.unwritten_mut(), action) - .map_err(|e| io::Error::other(e))?; + .map_err(io::Error::other)?; input.advance((self.compress.total_in() - prior_in) as usize); output.advance((self.compress.total_out() - prior_out) as usize); From 5da6467691c8d4fccf648ae9ed99317910dba789 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:55:07 +1000 Subject: [PATCH 18/29] Fix clippy error in bzip2 encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/bzip2/encoder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codec/bzip2/encoder.rs b/src/codec/bzip2/encoder.rs index 6f8f425..3dbfc1c 100644 --- a/src/codec/bzip2/encoder.rs +++ b/src/codec/bzip2/encoder.rs @@ -116,7 +116,7 @@ impl Encode for BzEncoder { // There was insufficient memory in the input or output buffer to complete // the request, but otherwise everything went normally. - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")), + Status::MemNeeded => Err(io::Error::other("out of memory")), } } @@ -142,7 +142,7 @@ impl Encode for BzEncoder { // There was insufficient memory in the input or output buffer to complete // the request, but otherwise everything went normally. - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")), + Status::MemNeeded => Err(io::Error::other("out of memory")), } } } From 6149d573bf61b3bdc95424ed33cdd5e9f9b8e559 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:57:19 +1000 Subject: [PATCH 19/29] Fix clippy error in xz2 decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/xz2/decoder.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/codec/xz2/decoder.rs b/src/codec/xz2/decoder.rs index 3e83ea8..22f5eec 100644 --- a/src/codec/xz2/decoder.rs +++ b/src/codec/xz2/decoder.rs @@ -47,7 +47,7 @@ impl Decode for Xz2Decoder { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), Status::GetCheck => Err(io::Error::other( - "Unexpected lzma integrity check" + "Unexpected lzma integrity check", )), Status::MemNeeded => Err(io::Error::other("More memory needed")), } @@ -76,11 +76,10 @@ impl Decode for Xz2Decoder { match status { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::GetCheck => Err(io::Error::new( - io::ErrorKind::Other, + Status::GetCheck => Err(io::Error::other( "Unexpected lzma integrity check", )), - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "More memory needed")), + Status::MemNeeded => Err(io::Error::other("More memory needed")), } } } From 9c3b91574b3e1e6a1e5b9edf33c22e3a5c98cddc Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:59:55 +1000 Subject: [PATCH 20/29] Fix clippy error in tokio/write/generic/decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/tokio/write/generic/decoder.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tokio/write/generic/decoder.rs b/src/tokio/write/generic/decoder.rs index d0ab145..16dd038 100644 --- a/src/tokio/write/generic/decoder.rs +++ b/src/tokio/write/generic/decoder.rs @@ -178,8 +178,7 @@ impl AsyncWrite for Decoder { ready!(self.as_mut().project().writer.as_mut().poll_shutdown(cx))?; Poll::Ready(Ok(())) } else { - Poll::Ready(Err(io::Error::new( - io::ErrorKind::Other, + Poll::Ready(Err(io::Error::other "Attempt to shutdown before finishing input", ))) } From 2834e8c69d762daca18cbaf65272d8359951aeb0 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:01:26 +1000 Subject: [PATCH 21/29] Fix fmt in brotli decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/brotli/decoder.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/codec/brotli/decoder.rs b/src/codec/brotli/decoder.rs index 56125b6..27e19b9 100644 --- a/src/codec/brotli/decoder.rs +++ b/src/codec/brotli/decoder.rs @@ -40,9 +40,7 @@ impl BrotliDecoder { &mut 0, &mut self.state, ) { - BrotliResult::ResultFailure => { - return Err(io::Error::other("brotli error")) - } + BrotliResult::ResultFailure => return Err(io::Error::other("brotli error")), status => status, }; From cd0c04fdef53ba95d8a09305b922f2e38e149a97 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:02:28 +1000 Subject: [PATCH 22/29] Fix fmt in xz2 decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/xz2/decoder.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/codec/xz2/decoder.rs b/src/codec/xz2/decoder.rs index 22f5eec..a51f714 100644 --- a/src/codec/xz2/decoder.rs +++ b/src/codec/xz2/decoder.rs @@ -46,9 +46,7 @@ impl Decode for Xz2Decoder { match status { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::GetCheck => Err(io::Error::other( - "Unexpected lzma integrity check", - )), + Status::GetCheck => Err(io::Error::other("Unexpected lzma integrity check")), Status::MemNeeded => Err(io::Error::other("More memory needed")), } } From b0517cc473eebfffeea88cacb1c71785398a530d Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:04:42 +1000 Subject: [PATCH 23/29] Fix clippy error and fmt in xz2 encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/xz2/encoder.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/codec/xz2/encoder.rs b/src/codec/xz2/encoder.rs index 081d227..f032c96 100644 --- a/src/codec/xz2/encoder.rs +++ b/src/codec/xz2/encoder.rs @@ -48,9 +48,7 @@ impl Encode for Xz2Encoder { match status { Status::Ok | Status::StreamEnd => Ok(()), - Status::GetCheck => Err(io::Error::other( - "Unexpected lzma integrity check" - )), + Status::GetCheck => Err(io::Error::other("Unexpected lzma integrity check")), Status::MemNeeded => Err(io::Error::other("out of memory")), } } @@ -70,11 +68,8 @@ impl Encode for Xz2Encoder { match status { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::GetCheck => Err(io::Error::new( - io::ErrorKind::Other, - "Unexpected lzma integrity check", - )), - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")), + Status::GetCheck => Err(io::Error::other("Unexpected lzma integrity check")), + Status::MemNeeded => Err(io::Error::other("out of memory")), } } @@ -93,11 +88,8 @@ impl Encode for Xz2Encoder { match status { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::GetCheck => Err(io::Error::new( - io::ErrorKind::Other, - "Unexpected lzma integrity check", - )), - Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")), + Status::GetCheck => Err(io::Error::other("Unexpected lzma integrity check")), + Status::MemNeeded => Err(io::Error::other("out of memory")), } } } From 5ea5bdf0755a02ac9184474d91dce7cef2bd9a82 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:06:09 +1000 Subject: [PATCH 24/29] Fix fmt in decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/futures/write/generic/decoder.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/futures/write/generic/decoder.rs b/src/futures/write/generic/decoder.rs index 9288ac9..31f6504 100644 --- a/src/futures/write/generic/decoder.rs +++ b/src/futures/write/generic/decoder.rs @@ -88,9 +88,7 @@ impl Decoder { } State::Done => { - return Poll::Ready(Err(io::Error::other( - "Write after end of stream", - ))) + return Poll::Ready(Err(io::Error::other("Write after end of stream"))) } }; From 6eeed32b716d356bd9ca374271e7286eb7767f4c Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:07:32 +1000 Subject: [PATCH 25/29] Fix fmt in future write generics encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/futures/write/generic/encoder.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/futures/write/generic/encoder.rs b/src/futures/write/generic/encoder.rs index 17dc3ea..abd18c4 100644 --- a/src/futures/write/generic/encoder.rs +++ b/src/futures/write/generic/encoder.rs @@ -87,9 +87,7 @@ impl Encoder { } State::Finishing | State::Done => { - return Poll::Ready(Err(io::Error::other( - "Write after close", - ))) + return Poll::Ready(Err(io::Error::other("Write after close"))) } }; @@ -113,9 +111,7 @@ impl Encoder { State::Encoding => this.encoder.flush(&mut output)?, State::Finishing | State::Done => { - return Poll::Ready(Err(io::Error::other( - "Flush after close", - ))) + return Poll::Ready(Err(io::Error::other("Flush after close"))) } }; From a5059d7288e3b21c17d2bb56fc52591510f7ba06 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:08:25 +1000 Subject: [PATCH 26/29] Fix fmt in tokio write generics decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/tokio/write/generic/decoder.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tokio/write/generic/decoder.rs b/src/tokio/write/generic/decoder.rs index 16dd038..a7865d9 100644 --- a/src/tokio/write/generic/decoder.rs +++ b/src/tokio/write/generic/decoder.rs @@ -88,9 +88,7 @@ impl Decoder { } State::Done => { - return Poll::Ready(Err(io::Error::other( - "Write after end of stream", - ))) + return Poll::Ready(Err(io::Error::other("Write after end of stream"))) } }; From 71ead804e8f7610c95ac08862f8791661e1b6b8d Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:09:17 +1000 Subject: [PATCH 27/29] Fix fmt in tokio generics write encoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/tokio/write/generic/encoder.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/tokio/write/generic/encoder.rs b/src/tokio/write/generic/encoder.rs index ef36d23..6e39bfb 100644 --- a/src/tokio/write/generic/encoder.rs +++ b/src/tokio/write/generic/encoder.rs @@ -96,9 +96,7 @@ impl Encoder { }, State::Finishing | State::Done => { - return Poll::Ready(Err(io::Error::other( - "Write after shutdown", - ))) + return Poll::Ready(Err(io::Error::other("Write after shutdown"))) } }; @@ -122,9 +120,7 @@ impl Encoder { State::Encoding | State::Flushing => this.encoder.flush(&mut output)?, State::Finishing | State::Done => { - return Poll::Ready(Err(io::Error::other( - "Flush after shutdown", - ))) + return Poll::Ready(Err(io::Error::other("Flush after shutdown"))) } }; *this.state = State::Flushing; From 656949713fa2f6e397ec4add2189d9e9865b34c1 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:11:50 +1000 Subject: [PATCH 28/29] Fix tokio write generics decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/tokio/write/generic/decoder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tokio/write/generic/decoder.rs b/src/tokio/write/generic/decoder.rs index a7865d9..075c1ec 100644 --- a/src/tokio/write/generic/decoder.rs +++ b/src/tokio/write/generic/decoder.rs @@ -176,7 +176,7 @@ impl AsyncWrite for Decoder { ready!(self.as_mut().project().writer.as_mut().poll_shutdown(cx))?; Poll::Ready(Ok(())) } else { - Poll::Ready(Err(io::Error::other + Poll::Ready(Err(io::Error::other( "Attempt to shutdown before finishing input", ))) } From 52d7d4c146abd3058dd22dc3201daad210ecbd47 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 10 Jun 2025 01:13:20 +1000 Subject: [PATCH 29/29] Fix fmt in decoder.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/codec/xz2/decoder.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/codec/xz2/decoder.rs b/src/codec/xz2/decoder.rs index a51f714..1c111fd 100644 --- a/src/codec/xz2/decoder.rs +++ b/src/codec/xz2/decoder.rs @@ -74,9 +74,7 @@ impl Decode for Xz2Decoder { match status { Status::Ok => Ok(false), Status::StreamEnd => Ok(true), - Status::GetCheck => Err(io::Error::other( - "Unexpected lzma integrity check", - )), + Status::GetCheck => Err(io::Error::other("Unexpected lzma integrity check")), Status::MemNeeded => Err(io::Error::other("More memory needed")), } }