Skip to content

Commit

Permalink
fix: clippy::needless_lifetimes
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Oct 23, 2024
1 parent 110b077 commit 037106e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/arch/x86_64/kernel/acpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub struct AcpiTable<'a> {
allocated_length: usize,
}

impl<'a> AcpiTable<'a> {
impl AcpiTable<'_> {
fn map(physical_address: PhysAddr) -> Self {
let mut flags = PageTableEntryFlags::empty();
flags.normal().read_only().execute_disable();
Expand Down Expand Up @@ -150,7 +150,7 @@ impl<'a> AcpiTable<'a> {
}
}

impl<'a> Drop for AcpiTable<'a> {
impl Drop for AcpiTable<'_> {
fn drop(&mut self) {
virtualmem::deallocate(self.allocated_virtual_address, self.allocated_length);
}
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/virtio/transport/mmio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct VqCfgHandler<'a> {
raw: VolatileRef<'a, DeviceRegisters>,
}

impl<'a> VqCfgHandler<'a> {
impl VqCfgHandler<'_> {
// TODO: Create type for queue selected invariant to get rid of `self.select_queue()` everywhere.
fn select_queue(&mut self) {
self.raw
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/virtio/transport/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub struct VqCfgHandler<'a> {
raw: VolatileRef<'a, CommonCfg>,
}

impl<'a> VqCfgHandler<'a> {
impl VqCfgHandler<'_> {
// TODO: Create type for queue selected invariant to get rid of `self.select_queue()` everywhere.
fn select_queue(&mut self) {
self.raw
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/virtio/virtqueue/packed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ struct ReadCtrl<'a> {
desc_ring: &'a mut DescriptorRing,
}

impl<'a> ReadCtrl<'a> {
impl ReadCtrl<'_> {
/// Polls the ring for a new finished buffer. If buffer is marked as finished, takes care of
/// updating the queue and returns the respective TransferToken.
fn poll_next(&mut self) -> Option<(Box<TransferToken<pvirtq::Desc>>, u32)> {
Expand Down Expand Up @@ -378,7 +378,7 @@ struct WriteCtrl<'a> {
desc_ring: &'a mut DescriptorRing,
}

impl<'a> WriteCtrl<'a> {
impl WriteCtrl<'_> {
/// **This function MUST only be used within the WriteCtrl.write_desc() function!**
///
/// Incrementing index by one. The index wrappes around to zero when
Expand Down

0 comments on commit 037106e

Please sign in to comment.