Skip to content

Commit f6c5cb2

Browse files
committed
chore(*): set clippy unused_trait_names = warn
We have previously tried to import traits anonymously where possible but enforcing this manually was hard. Since Rust 1.83 clippy can now enforce this for us. Signed-off-by: Dave Tucker <[email protected]>
1 parent 34a3d6c commit f6c5cb2

File tree

26 files changed

+34
-31
lines changed

26 files changed

+34
-31
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ which = { version = "7.0.0", default-features = false }
107107
xdpilone = { version = "1.0.5", default-features = false }
108108
xz2 = { version = "0.1.7", default-features = false }
109109

110+
[workspace.lints.clippy]
111+
unused_trait_names = "warn"
112+
110113
[workspace.lints.rust]
111114
unused-extern-crates = "warn"
112115

aya-log/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ fn try_read<T: Pod>(mut buf: &[u8]) -> Result<(T, &[u8], &[u8]), ()> {
736736
mod test {
737737
use std::net::IpAddr;
738738

739-
use aya_log_common::{WriteToBuf, write_record_header};
739+
use aya_log_common::{WriteToBuf as _, write_record_header};
740740
use log::{Level, logger};
741741

742742
use super::*;

aya-obj/src/btf/btf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use alloc::{
77
};
88
use core::{ffi::CStr, mem, ptr};
99

10-
use bytes::BufMut;
10+
use bytes::BufMut as _;
1111
use log::debug;
1212
use object::{Endianness, SectionIndex};
1313

@@ -308,7 +308,7 @@ impl Btf {
308308
path: P,
309309
endianness: Endianness,
310310
) -> Result<Btf, BtfError> {
311-
use std::{borrow::ToOwned, fs};
311+
use std::{borrow::ToOwned as _, fs};
312312
let path = path.as_ref();
313313
Btf::parse(
314314
&fs::read(path).map_err(|error| BtfError::FileError {

aya-obj/src/btf/info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use alloc::{string::String, vec, vec::Vec};
22

3-
use bytes::BufMut;
3+
use bytes::BufMut as _;
44
use object::Endianness;
55

66
use crate::{

aya-obj/src/btf/relocation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use alloc::{
22
borrow::{Cow, ToOwned as _},
33
collections::BTreeMap,
44
format,
5-
string::{String, ToString},
5+
string::{String, ToString as _},
66
vec,
77
vec::Vec,
88
};

aya-obj/src/btf/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![expect(missing_docs)]
22

3-
use alloc::{string::ToString, vec, vec::Vec};
3+
use alloc::{string::ToString as _, vec, vec::Vec};
44
use core::{fmt::Display, mem, ptr};
55

66
use object::Endianness;

aya-obj/src/obj.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
//! Object file loading, parsing, and relocation.
22
33
use alloc::{
4-
borrow::ToOwned,
4+
borrow::ToOwned as _,
55
collections::BTreeMap,
66
ffi::CString,
7-
string::{String, ToString},
7+
string::{String, ToString as _},
88
vec,
99
vec::Vec,
1010
};
1111
use core::{ffi::CStr, mem, ptr, slice::from_raw_parts_mut, str::FromStr};
1212

1313
use log::debug;
1414
use object::{
15-
Endianness, ObjectSymbol, ObjectSymbolTable, RelocationTarget, SectionIndex, SectionKind,
16-
SymbolKind,
17-
read::{Object as ElfObject, ObjectSection, Section as ObjSection},
15+
Endianness, ObjectSymbol as _, ObjectSymbolTable as _, RelocationTarget, SectionIndex,
16+
SectionKind, SymbolKind,
17+
read::{Object as _, ObjectSection as _, Section as ObjSection},
1818
};
1919

2020
use crate::{

aya-obj/src/relocation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Program relocation handling.
22
3-
use alloc::{borrow::ToOwned, collections::BTreeMap, string::String};
3+
use alloc::{borrow::ToOwned as _, collections::BTreeMap, string::String};
44
use core::mem;
55

66
use log::debug;
@@ -502,7 +502,7 @@ fn insn_is_call(ins: &bpf_insn) -> bool {
502502

503503
#[cfg(test)]
504504
mod test {
505-
use alloc::{string::ToString, vec, vec::Vec};
505+
use alloc::{string::ToString as _, vec, vec::Vec};
506506

507507
use super::*;
508508
use crate::maps::{BtfMap, LegacyMap};

aya-tool/src/generate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{
22
fs::{self, File},
3-
io::{self, Write},
3+
io::{self, Write as _},
44
path::{Path, PathBuf},
55
process::Command,
66
str,

aya/src/maps/perf/perf_event_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! [`perf`]: https://perf.wiki.kernel.org/index.php/Main_Page.
44
use std::{
55
borrow::{Borrow, BorrowMut},
6-
ops::Deref,
6+
ops::Deref as _,
77
os::fd::{AsFd, AsRawFd, BorrowedFd, RawFd},
88
path::Path,
99
sync::Arc,

0 commit comments

Comments
 (0)