Skip to content

Commit f23ff2d

Browse files
authored
Merge pull request #2383 from hermit-os/single_use_lifetimes
fix: single_use_lifetimes
2 parents d73d0e9 + f5fd4d7 commit f23ff2d

5 files changed

Lines changed: 9 additions & 8 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ rust_2018_idioms = "warn"
399399

400400
# Lints
401401
redundant_imports = "warn"
402+
single_use_lifetimes = "warn"
402403
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(careful)'] }
403404
unsafe_op_in_unsafe_fn = "warn"
404405
unused_qualifications = "warn"

src/arch/x86_64/mm/paging.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ pub mod mapped_page_table_iter {
604604
}
605605
}
606606

607-
impl<'a, P: PageTableFrameMapping> Iterator for MappedPageTableRangeInclusiveIter<'a, P> {
607+
impl<P: PageTableFrameMapping> Iterator for MappedPageTableRangeInclusiveIter<'_, P> {
608608
type Item = MappedPageRangeInclusiveItem;
609609

610610
fn next(&mut self) -> Option<Self::Item> {
@@ -753,7 +753,7 @@ pub mod mapped_page_table_iter {
753753
}
754754
}
755755

756-
impl<'a, P: PageTableFrameMapping> MappedPageTableIter<'a, P> {
756+
impl<P: PageTableFrameMapping> MappedPageTableIter<'_, P> {
757757
fn p4_index(&self) -> Option<PageTableIndex> {
758758
if self.p4_index >= 512 {
759759
return None;
@@ -918,7 +918,7 @@ pub mod mapped_page_table_iter {
918918
}
919919
}
920920

921-
impl<'a, P: PageTableFrameMapping> Iterator for MappedPageTableIter<'a, P> {
921+
impl<P: PageTableFrameMapping> Iterator for MappedPageTableIter<'_, P> {
922922
type Item = MappedPageItem;
923923

924924
fn next(&mut self) -> Option<Self::Item> {

src/drivers/net/gem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ impl smoltcp::phy::Device for GEMDriver {
449449
}
450450
}
451451

452-
impl<'a> smoltcp::phy::RxToken for RxToken<'a> {
452+
impl smoltcp::phy::RxToken for RxToken<'_> {
453453
fn consume<R, F>(mut self, f: F) -> R
454454
where
455455
F: FnOnce(&[u8]) -> R,
@@ -483,7 +483,7 @@ impl Drop for RxToken<'_> {
483483
}
484484
}
485485

486-
impl<'a> smoltcp::phy::TxToken for TxToken<'a> {
486+
impl smoltcp::phy::TxToken for TxToken<'_> {
487487
fn consume<R, F>(self, len: usize, f: F) -> R
488488
where
489489
F: FnOnce(&mut [u8]) -> R,

src/drivers/net/rtl8139.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ pub struct RxToken<'a> {
491491
rx_fields: &'a mut RxFields,
492492
}
493493

494-
impl<'a> smoltcp::phy::RxToken for RxToken<'a> {
494+
impl smoltcp::phy::RxToken for RxToken<'_> {
495495
fn consume<R, F>(mut self, f: F) -> R
496496
where
497497
F: FnOnce(&[u8]) -> R,
@@ -540,7 +540,7 @@ impl Drop for TxToken<'_> {
540540
}
541541
}
542542

543-
impl<'a> smoltcp::phy::TxToken for TxToken<'a> {
543+
impl smoltcp::phy::TxToken for TxToken<'_> {
544544
fn consume<R, F>(self, len: usize, f: F) -> R
545545
where
546546
F: FnOnce(&mut [u8]) -> R,

src/syscalls/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ mod dirent_display {
775775
}
776776
}
777777

778-
impl<'a> fmt::Debug for Dirent64Display<'a> {
778+
impl fmt::Debug for Dirent64Display<'_> {
779779
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
780780
let cstr = unsafe { CStr::from_ptr((&raw const self.dirent.d_name).cast::<c_char>()) };
781781

0 commit comments

Comments
 (0)