Skip to content

Commit

Permalink
Elide explicit lifetimes when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-opp committed Oct 7, 2024
1 parent 19cca17 commit ecccf11
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/structures/paging/mapper/mapped_page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl<'a, P: PageTableFrameMapping> MappedPageTable<'a, P> {
}
}

impl<'a, P: PageTableFrameMapping> Mapper<Size1GiB> for MappedPageTable<'a, P> {
impl<P: PageTableFrameMapping> Mapper<Size1GiB> for MappedPageTable<'_, P> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -258,7 +258,7 @@ impl<'a, P: PageTableFrameMapping> Mapper<Size1GiB> for MappedPageTable<'a, P> {
}
}

impl<'a, P: PageTableFrameMapping> Mapper<Size2MiB> for MappedPageTable<'a, P> {
impl<P: PageTableFrameMapping> Mapper<Size2MiB> for MappedPageTable<'_, P> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -386,7 +386,7 @@ impl<'a, P: PageTableFrameMapping> Mapper<Size2MiB> for MappedPageTable<'a, P> {
}
}

impl<'a, P: PageTableFrameMapping> Mapper<Size4KiB> for MappedPageTable<'a, P> {
impl<P: PageTableFrameMapping> Mapper<Size4KiB> for MappedPageTable<'_, P> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -530,7 +530,7 @@ impl<'a, P: PageTableFrameMapping> Mapper<Size4KiB> for MappedPageTable<'a, P> {
}
}

impl<'a, P: PageTableFrameMapping> Translate for MappedPageTable<'a, P> {
impl<P: PageTableFrameMapping> Translate for MappedPageTable<'_, P> {
#[allow(clippy::inconsistent_digit_grouping)]
fn translate(&self, addr: VirtAddr) -> TranslateResult {
let p4 = &self.level_4_table;
Expand Down Expand Up @@ -594,7 +594,7 @@ impl<'a, P: PageTableFrameMapping> Translate for MappedPageTable<'a, P> {
}
}

impl<'a, P: PageTableFrameMapping> CleanUp for MappedPageTable<'a, P> {
impl<P: PageTableFrameMapping> CleanUp for MappedPageTable<'_, P> {
#[inline]
unsafe fn clean_up<D>(&mut self, frame_deallocator: &mut D)
where
Expand Down
10 changes: 5 additions & 5 deletions src/structures/paging/mapper/offset_page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ unsafe impl PageTableFrameMapping for PhysOffset {

// delegate all trait implementations to inner

impl<'a> Mapper<Size1GiB> for OffsetPageTable<'a> {
impl Mapper<Size1GiB> for OffsetPageTable<'_> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<'a> Mapper<Size1GiB> for OffsetPageTable<'a> {
}
}

impl<'a> Mapper<Size2MiB> for OffsetPageTable<'a> {
impl Mapper<Size2MiB> for OffsetPageTable<'_> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -203,7 +203,7 @@ impl<'a> Mapper<Size2MiB> for OffsetPageTable<'a> {
}
}

impl<'a> Mapper<Size4KiB> for OffsetPageTable<'a> {
impl Mapper<Size4KiB> for OffsetPageTable<'_> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -272,14 +272,14 @@ impl<'a> Mapper<Size4KiB> for OffsetPageTable<'a> {
}
}

impl<'a> Translate for OffsetPageTable<'a> {
impl Translate for OffsetPageTable<'_> {
#[inline]
fn translate(&self, addr: VirtAddr) -> TranslateResult {
self.inner.translate(addr)
}
}

impl<'a> CleanUp for OffsetPageTable<'a> {
impl CleanUp for OffsetPageTable<'_> {
#[inline]
unsafe fn clean_up<D>(&mut self, frame_deallocator: &mut D)
where
Expand Down
10 changes: 5 additions & 5 deletions src/structures/paging/mapper/recursive_page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl<'a> RecursivePageTable<'a> {
}
}

impl<'a> Mapper<Size1GiB> for RecursivePageTable<'a> {
impl Mapper<Size1GiB> for RecursivePageTable<'_> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -419,7 +419,7 @@ impl<'a> Mapper<Size1GiB> for RecursivePageTable<'a> {
}
}

impl<'a> Mapper<Size2MiB> for RecursivePageTable<'a> {
impl Mapper<Size2MiB> for RecursivePageTable<'_> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -574,7 +574,7 @@ impl<'a> Mapper<Size2MiB> for RecursivePageTable<'a> {
}
}

impl<'a> Mapper<Size4KiB> for RecursivePageTable<'a> {
impl Mapper<Size4KiB> for RecursivePageTable<'_> {
#[inline]
unsafe fn map_to_with_table_flags<A>(
&mut self,
Expand Down Expand Up @@ -763,7 +763,7 @@ impl<'a> Mapper<Size4KiB> for RecursivePageTable<'a> {
}
}

impl<'a> Translate for RecursivePageTable<'a> {
impl Translate for RecursivePageTable<'_> {
#[allow(clippy::inconsistent_digit_grouping)]
fn translate(&self, addr: VirtAddr) -> TranslateResult {
let page = Page::containing_address(addr);
Expand Down Expand Up @@ -836,7 +836,7 @@ impl<'a> Translate for RecursivePageTable<'a> {
}
}

impl<'a> CleanUp for RecursivePageTable<'a> {
impl CleanUp for RecursivePageTable<'_> {
#[inline]
unsafe fn clean_up<D>(&mut self, frame_deallocator: &mut D)
where
Expand Down

0 comments on commit ecccf11

Please sign in to comment.