ci(clippy): bump to 1.84

- updates the rust version on clippy step to `1.84`
- fixes the found clippy issues
This commit is contained in:
Leonardo Lima 2025-01-20 13:30:33 -03:00
parent 5a476fdfd9
commit 3dc4daceaf
No known key found for this signature in database
GPG Key ID: 9FA9A7938187D298
4 changed files with 9 additions and 8 deletions

View File

@ -57,12 +57,13 @@ jobs:
run: cargo fmt --all -- --config format_code_in_doc_comments=true --check run: cargo fmt --all -- --config format_code_in_doc_comments=true --check
clippy_check: clippy_check:
name: Rust clippy
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: 1.78.0 toolchain: 1.84.0
components: clippy components: clippy
- name: Rust Cache - name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1 uses: Swatinem/rust-cache@v2.2.1

View File

@ -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<TargetAddr> { fn to_target_addr(&self) -> io::Result<TargetAddr> {
// try to parse as an IP first // try to parse as an IP first
if let Ok(addr) = self.0.parse::<Ipv4Addr>() { if let Ok(addr) = self.0.parse::<Ipv4Addr>() {
@ -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<TargetAddr> { fn to_target_addr(&self) -> io::Result<TargetAddr> {
// try to parse as an IP first // try to parse as an IP first
if let Ok(addr) = self.parse::<SocketAddrV4>() { if let Ok(addr) = self.parse::<SocketAddrV4>() {

View File

@ -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<usize> { fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
(&self.socket).read(buf) (&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<usize> { fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
(&self.socket).write(buf) (&self.socket).write(buf)
} }

View File

@ -135,7 +135,7 @@ enum Authentication<'a> {
None, None,
} }
impl<'a> Authentication<'a> { impl Authentication<'_> {
fn id(&self) -> u8 { fn id(&self) -> u8 {
match *self { match *self {
Authentication::Password { .. } => 2, 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<usize> { fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
(&self.socket).read(buf) (&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<usize> { fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
(&self.socket).write(buf) (&self.socket).write(buf)
} }