diff --git a/g3proxy/src/escape/direct_fixed/http_forward/writer.rs b/g3proxy/src/escape/direct_fixed/http_forward/writer.rs index fc7610af..bbf04d68 100644 --- a/g3proxy/src/escape/direct_fixed/http_forward/writer.rs +++ b/g3proxy/src/escape/direct_fixed/http_forward/writer.rs @@ -62,17 +62,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } diff --git a/g3proxy/src/escape/direct_float/http_forward/writer.rs b/g3proxy/src/escape/direct_float/http_forward/writer.rs index ecc4d20b..f9e6d288 100644 --- a/g3proxy/src/escape/direct_float/http_forward/writer.rs +++ b/g3proxy/src/escape/direct_float/http_forward/writer.rs @@ -69,17 +69,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } diff --git a/g3proxy/src/escape/proxy_float/peer/http/http_forward/writer.rs b/g3proxy/src/escape/proxy_float/peer/http/http_forward/writer.rs index 39c810be..a3dbe601 100644 --- a/g3proxy/src/escape/proxy_float/peer/http/http_forward/writer.rs +++ b/g3proxy/src/escape/proxy_float/peer/http/http_forward/writer.rs @@ -72,17 +72,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } @@ -170,17 +170,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } diff --git a/g3proxy/src/escape/proxy_float/peer/https/http_forward/writer.rs b/g3proxy/src/escape/proxy_float/peer/https/http_forward/writer.rs index ec0431c1..b0edf26b 100644 --- a/g3proxy/src/escape/proxy_float/peer/https/http_forward/writer.rs +++ b/g3proxy/src/escape/proxy_float/peer/https/http_forward/writer.rs @@ -69,17 +69,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } @@ -155,17 +155,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } diff --git a/g3proxy/src/escape/proxy_float/peer/socks5/http_forward/writer.rs b/g3proxy/src/escape/proxy_float/peer/socks5/http_forward/writer.rs index 953a160c..e769a459 100644 --- a/g3proxy/src/escape/proxy_float/peer/socks5/http_forward/writer.rs +++ b/g3proxy/src/escape/proxy_float/peer/socks5/http_forward/writer.rs @@ -69,17 +69,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } diff --git a/g3proxy/src/escape/proxy_http/http_forward/writer.rs b/g3proxy/src/escape/proxy_http/http_forward/writer.rs index 8963dc51..6746ec9e 100644 --- a/g3proxy/src/escape/proxy_http/http_forward/writer.rs +++ b/g3proxy/src/escape/proxy_http/http_forward/writer.rs @@ -73,17 +73,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } @@ -164,17 +164,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } diff --git a/g3proxy/src/escape/proxy_https/http_forward/writer.rs b/g3proxy/src/escape/proxy_https/http_forward/writer.rs index 05a2315d..d89fe3f1 100644 --- a/g3proxy/src/escape/proxy_https/http_forward/writer.rs +++ b/g3proxy/src/escape/proxy_https/http_forward/writer.rs @@ -70,17 +70,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } @@ -149,17 +149,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } diff --git a/g3proxy/src/escape/proxy_socks5/http_forward/writer.rs b/g3proxy/src/escape/proxy_socks5/http_forward/writer.rs index f35d0c95..e6e694e4 100644 --- a/g3proxy/src/escape/proxy_socks5/http_forward/writer.rs +++ b/g3proxy/src/escape/proxy_socks5/http_forward/writer.rs @@ -62,17 +62,17 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { let this = self.project(); this.inner.poll_write(cx, buf) } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); this.inner.poll_shutdown(cx) } diff --git a/lib/g3-icap-client/src/service/connection.rs b/lib/g3-icap-client/src/service/connection.rs index d32a7830..d20b3647 100644 --- a/lib/g3-icap-client/src/service/connection.rs +++ b/lib/g3-icap-client/src/service/connection.rs @@ -41,7 +41,7 @@ impl IcapConnectionCreator { IcapConnectionCreator { config } } - async fn select_peer_addr(&self) -> Result { + async fn select_peer_addr(&self) -> io::Result { let upstream = &self.config.upstream; match upstream.host() { Host::Domain(domain) => { diff --git a/lib/g3-io-ext/src/udp/recv.rs b/lib/g3-io-ext/src/udp/recv.rs index 9ad8f7b2..e4ab71c3 100644 --- a/lib/g3-io-ext/src/udp/recv.rs +++ b/lib/g3-io-ext/src/udp/recv.rs @@ -31,10 +31,9 @@ pub trait AsyncUdpRecv { &mut self, cx: &mut Context<'_>, buf: &mut [u8], - ) -> Poll>; + ) -> Poll>; - fn poll_recv(&mut self, cx: &mut Context<'_>, buf: &mut [u8]) - -> Poll>; + fn poll_recv(&mut self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll>; } pub struct LimitedUdpRecv { @@ -79,7 +78,7 @@ where &mut self, cx: &mut Context<'_>, buf: &mut [u8], - ) -> Poll> { + ) -> Poll> { if self.limit.is_set() { let dur_millis = self.started.elapsed().as_millis() as u64; match self.limit.check_packet(dur_millis, buf.len()) { @@ -107,11 +106,7 @@ where } } - fn poll_recv( - &mut self, - cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { + fn poll_recv(&mut self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll> { if self.limit.is_set() { let dur_millis = self.started.elapsed().as_millis() as u64; match self.limit.check_packet(dur_millis, buf.len()) { diff --git a/lib/g3-io-ext/src/udp/split.rs b/lib/g3-io-ext/src/udp/split.rs index 543226b3..0526e8ac 100644 --- a/lib/g3-io-ext/src/udp/split.rs +++ b/lib/g3-io-ext/src/udp/split.rs @@ -111,17 +111,13 @@ impl AsyncUdpRecv for RecvHalf { &mut self, cx: &mut Context<'_>, buf: &mut [u8], - ) -> Poll> { + ) -> Poll> { let mut buf = ReadBuf::new(buf); let addr = ready!(self.0.poll_recv_from(cx, &mut buf))?; Poll::Ready(Ok((buf.filled().len(), addr))) } - fn poll_recv( - &mut self, - cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { + fn poll_recv(&mut self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll> { let mut buf = ReadBuf::new(buf); ready!(self.0.poll_recv(cx, &mut buf))?; Poll::Ready(Ok(buf.filled().len()))