From 3dc4daceaffcdb3ad0f6c21a7d5a1ac92df0bab7 Mon Sep 17 00:00:00 2001 From: Leonardo Lima Date: Mon, 20 Jan 2025 13:30:33 -0300 Subject: [PATCH] ci(clippy): bump to `1.84` - updates the rust version on clippy step to `1.84` - fixes the found clippy issues --- .github/workflows/cont_integration.yml | 3 ++- src/socks/mod.rs | 4 ++-- src/socks/v4.rs | 4 ++-- src/socks/v5.rs | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 11fbc98..93aae51 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -57,12 +57,13 @@ jobs: run: cargo fmt --all -- --config format_code_in_doc_comments=true --check clippy_check: + name: Rust clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.78.0 + toolchain: 1.84.0 components: clippy - name: Rust Cache uses: Swatinem/rust-cache@v2.2.1 diff --git a/src/socks/mod.rs b/src/socks/mod.rs index 5aa29c0..2767b9d 100644 --- a/src/socks/mod.rs +++ b/src/socks/mod.rs @@ -99,7 +99,7 @@ impl ToTargetAddr for (Ipv6Addr, u16) { } } -impl<'a> ToTargetAddr for (&'a str, u16) { +impl ToTargetAddr for (&str, u16) { fn to_target_addr(&self) -> io::Result { // try to parse as an IP first if let Ok(addr) = self.0.parse::() { @@ -114,7 +114,7 @@ impl<'a> ToTargetAddr for (&'a str, u16) { } } -impl<'a> ToTargetAddr for &'a str { +impl ToTargetAddr for &str { fn to_target_addr(&self) -> io::Result { // try to parse as an IP first if let Ok(addr) = self.parse::() { diff --git a/src/socks/v4.rs b/src/socks/v4.rs index ed269b1..9d0fc3f 100644 --- a/src/socks/v4.rs +++ b/src/socks/v4.rs @@ -148,7 +148,7 @@ impl Read for Socks4Stream { } } -impl<'a> Read for &'a Socks4Stream { +impl Read for &Socks4Stream { fn read(&mut self, buf: &mut [u8]) -> io::Result { (&self.socket).read(buf) } @@ -164,7 +164,7 @@ impl Write for Socks4Stream { } } -impl<'a> Write for &'a Socks4Stream { +impl Write for &Socks4Stream { fn write(&mut self, buf: &[u8]) -> io::Result { (&self.socket).write(buf) } diff --git a/src/socks/v5.rs b/src/socks/v5.rs index de54747..7a602d2 100644 --- a/src/socks/v5.rs +++ b/src/socks/v5.rs @@ -135,7 +135,7 @@ enum Authentication<'a> { None, } -impl<'a> Authentication<'a> { +impl Authentication<'_> { fn id(&self) -> u8 { match *self { Authentication::Password { .. } => 2, @@ -329,7 +329,7 @@ impl Read for Socks5Stream { } } -impl<'a> Read for &'a Socks5Stream { +impl Read for &Socks5Stream { fn read(&mut self, buf: &mut [u8]) -> io::Result { (&self.socket).read(buf) } @@ -345,7 +345,7 @@ impl Write for Socks5Stream { } } -impl<'a> Write for &'a Socks5Stream { +impl Write for &Socks5Stream { fn write(&mut self, buf: &[u8]) -> io::Result { (&self.socket).write(buf) }