Skip to content

Commit 0a32dac

Browse files
committed
Appease clippy
``` error: unnecessary structure name repetition --> aya/src/bpf.rs:198:57 | 198 | pub fn btf(&mut self, btf: Option<&'a Btf>) -> &mut EbpfLoader<'a> { | ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self note: the lint level is defined here --> aya/src/lib.rs:42:5 | 42 | clippy::use_self, | ^^^^^^^^^^^^^^^^ error: unnecessary structure name repetition --> aya/src/bpf.rs:222:54 | 222 | pub fn allow_unsupported_maps(&mut self) -> &mut EbpfLoader<'a> { | ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self error: unnecessary structure name repetition --> aya/src/bpf.rs:243:69 | 243 | pub fn map_pin_path<P: AsRef<Path>>(&mut self, path: P) -> &mut EbpfLoader<'a> { | ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self error: unnecessary structure name repetition --> aya/src/bpf.rs:292:15 | 292 | ) -> &mut EbpfLoader<'a> { | ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self error: unnecessary structure name repetition --> aya/src/bpf.rs:313:73 | 313 | pub fn set_max_entries(&mut self, name: &'a str, size: u32) -> &mut EbpfLoader<'a> { | ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self error: unnecessary structure name repetition --> aya/src/bpf.rs:335:56 | 335 | pub fn extension(&mut self, name: &'a str) -> &mut EbpfLoader<'a> { | ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self error: unnecessary structure name repetition --> aya/src/bpf.rs:353:75 | 353 | pub fn verifier_log_level(&mut self, level: VerifierLogLevel) -> &mut EbpfLoader<'a> { | ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self ``` See rust-lang/rust-clippy#12386.
1 parent c302f83 commit 0a32dac

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

aya/src/bpf.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<'a> EbpfLoader<'a> {
195195
///
196196
/// # Ok::<(), aya::EbpfError>(())
197197
/// ```
198-
pub fn btf(&mut self, btf: Option<&'a Btf>) -> &mut EbpfLoader<'a> {
198+
pub fn btf(&mut self, btf: Option<&'a Btf>) -> &mut Self {
199199
self.btf = btf.map(Cow::Borrowed);
200200
self
201201
}
@@ -219,7 +219,7 @@ impl<'a> EbpfLoader<'a> {
219219
/// # Ok::<(), aya::EbpfError>(())
220220
/// ```
221221
///
222-
pub fn allow_unsupported_maps(&mut self) -> &mut EbpfLoader<'a> {
222+
pub fn allow_unsupported_maps(&mut self) -> &mut Self {
223223
self.allow_unsupported_maps = true;
224224
self
225225
}
@@ -240,7 +240,7 @@ impl<'a> EbpfLoader<'a> {
240240
/// # Ok::<(), aya::EbpfError>(())
241241
/// ```
242242
///
243-
pub fn map_pin_path<P: AsRef<Path>>(&mut self, path: P) -> &mut EbpfLoader<'a> {
243+
pub fn map_pin_path<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
244244
self.map_pin_path = Some(path.as_ref().to_owned());
245245
self
246246
}
@@ -289,7 +289,7 @@ impl<'a> EbpfLoader<'a> {
289289
name: &'a str,
290290
value: T,
291291
must_exist: bool,
292-
) -> &mut EbpfLoader<'a> {
292+
) -> &mut Self {
293293
self.globals.insert(name, (value.into().bytes, must_exist));
294294
self
295295
}
@@ -310,7 +310,7 @@ impl<'a> EbpfLoader<'a> {
310310
/// # Ok::<(), aya::EbpfError>(())
311311
/// ```
312312
///
313-
pub fn set_max_entries(&mut self, name: &'a str, size: u32) -> &mut EbpfLoader<'a> {
313+
pub fn set_max_entries(&mut self, name: &'a str, size: u32) -> &mut Self {
314314
self.max_entries.insert(name, size);
315315
self
316316
}
@@ -332,7 +332,7 @@ impl<'a> EbpfLoader<'a> {
332332
/// # Ok::<(), aya::EbpfError>(())
333333
/// ```
334334
///
335-
pub fn extension(&mut self, name: &'a str) -> &mut EbpfLoader<'a> {
335+
pub fn extension(&mut self, name: &'a str) -> &mut Self {
336336
self.extensions.insert(name);
337337
self
338338
}
@@ -350,7 +350,7 @@ impl<'a> EbpfLoader<'a> {
350350
/// # Ok::<(), aya::EbpfError>(())
351351
/// ```
352352
///
353-
pub fn verifier_log_level(&mut self, level: VerifierLogLevel) -> &mut EbpfLoader<'a> {
353+
pub fn verifier_log_level(&mut self, level: VerifierLogLevel) -> &mut Self {
354354
self.verifier_log_level = level;
355355
self
356356
}

xtask/public-api/aya.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8647,16 +8647,16 @@ impl<T> core::convert::From<T> for aya::Ebpf
86478647
pub fn aya::Ebpf::from(t: T) -> T
86488648
pub struct aya::EbpfLoader<'a>
86498649
impl<'a> aya::EbpfLoader<'a>
8650-
pub fn aya::EbpfLoader<'a>::allow_unsupported_maps(&mut self) -> &mut aya::EbpfLoader<'a>
8651-
pub fn aya::EbpfLoader<'a>::btf(&mut self, btf: core::option::Option<&'a aya_obj::btf::btf::Btf>) -> &mut aya::EbpfLoader<'a>
8652-
pub fn aya::EbpfLoader<'a>::extension(&mut self, name: &'a str) -> &mut aya::EbpfLoader<'a>
8650+
pub fn aya::EbpfLoader<'a>::allow_unsupported_maps(&mut self) -> &mut Self
8651+
pub fn aya::EbpfLoader<'a>::btf(&mut self, btf: core::option::Option<&'a aya_obj::btf::btf::Btf>) -> &mut Self
8652+
pub fn aya::EbpfLoader<'a>::extension(&mut self, name: &'a str) -> &mut Self
86538653
pub fn aya::EbpfLoader<'a>::load(&mut self, data: &[u8]) -> core::result::Result<aya::Ebpf, aya::EbpfError>
86548654
pub fn aya::EbpfLoader<'a>::load_file<P: core::convert::AsRef<std::path::Path>>(&mut self, path: P) -> core::result::Result<aya::Ebpf, aya::EbpfError>
8655-
pub fn aya::EbpfLoader<'a>::map_pin_path<P: core::convert::AsRef<std::path::Path>>(&mut self, path: P) -> &mut aya::EbpfLoader<'a>
8655+
pub fn aya::EbpfLoader<'a>::map_pin_path<P: core::convert::AsRef<std::path::Path>>(&mut self, path: P) -> &mut Self
86568656
pub fn aya::EbpfLoader<'a>::new() -> Self
8657-
pub fn aya::EbpfLoader<'a>::set_global<T: core::convert::Into<aya::GlobalData<'a>>>(&mut self, name: &'a str, value: T, must_exist: bool) -> &mut aya::EbpfLoader<'a>
8658-
pub fn aya::EbpfLoader<'a>::set_max_entries(&mut self, name: &'a str, size: u32) -> &mut aya::EbpfLoader<'a>
8659-
pub fn aya::EbpfLoader<'a>::verifier_log_level(&mut self, level: aya::VerifierLogLevel) -> &mut aya::EbpfLoader<'a>
8657+
pub fn aya::EbpfLoader<'a>::set_global<T: core::convert::Into<aya::GlobalData<'a>>>(&mut self, name: &'a str, value: T, must_exist: bool) -> &mut Self
8658+
pub fn aya::EbpfLoader<'a>::set_max_entries(&mut self, name: &'a str, size: u32) -> &mut Self
8659+
pub fn aya::EbpfLoader<'a>::verifier_log_level(&mut self, level: aya::VerifierLogLevel) -> &mut Self
86608660
impl core::default::Default for aya::EbpfLoader<'_>
86618661
pub fn aya::EbpfLoader<'_>::default() -> Self
86628662
impl<'a> core::fmt::Debug for aya::EbpfLoader<'a>

0 commit comments

Comments
 (0)