Skip to content

Commit

Permalink
Fix clippy lints for Rust 1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmooney committed Dec 2, 2024
1 parent fca969a commit 8e5693b
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin/propolis-server/src/lib/migrate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl<'a> PageIter<'a> {
}
}

impl<'a> Iterator for PageIter<'a> {
impl Iterator for PageIter<'_> {
type Item = u64;
fn next(&mut self) -> Option<Self::Item> {
while self.current < self.end {
Expand Down
2 changes: 1 addition & 1 deletion bin/propolis-server/src/lib/stats/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ mod kstat_types {
fn as_u64(&self) -> Result<u64, Error>;
}

impl<'a> ConvertNamedData for NamedData<'a> {
impl ConvertNamedData for NamedData<'_> {
fn as_i32(&self) -> Result<i32, Error> {
unimplemented!()
}
Expand Down
2 changes: 1 addition & 1 deletion crates/nvpair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub enum NvName<'a> {
Owned(Vec<u8>),
Loaned(&'a [u8]),
}
impl<'a> NvName<'a> {
impl NvName<'_> {
pub fn as_ptr(&self) -> *const i8 {
match self {
NvName::Owned(v) => v.as_ptr().cast(),
Expand Down
2 changes: 1 addition & 1 deletion lib/propolis/src/hw/ibmpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

/// IO port and IRQ definitions for standard IBM PC hardware
//! IO port and IRQ definitions for standard IBM PC hardware
pub const PORT_COM1: u16 = 0x3f8;
pub const PORT_COM2: u16 = 0x2f8;
Expand Down
6 changes: 3 additions & 3 deletions lib/propolis/src/hw/nvme/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ struct QueueGuard<'a, QS: Debug> {
state: MutexGuard<'a, QueueInner<QS>>,
size: &'a u32,
}
impl<'a, QS: Debug> QueueGuard<'a, QS> {
impl<QS: Debug> QueueGuard<'_, QS> {
/// Returns if the queue is currently empty with the given head and tail
/// pointers.
///
Expand Down Expand Up @@ -198,7 +198,7 @@ impl<'a, QS: Debug> QueueGuard<'a, QS> {
wrap_sub(*self.size, idx, off)
}
}
impl<'a> QueueGuard<'a, CompQueueState> {
impl QueueGuard<'_, CompQueueState> {
/// Attempt to return the Tail entry pointer and then move it forward by 1.
///
/// If the queue is full this method returns [`None`].
Expand Down Expand Up @@ -297,7 +297,7 @@ impl SubQueueState {
QueueState::new(size, SubQueueState())
}
}
impl<'a> QueueGuard<'a, SubQueueState> {
impl QueueGuard<'_, SubQueueState> {
/// How many slots are empty between the tail and the head i.e., how many
/// entries can we write to the queue currently.
fn avail_empty(&self) -> u16 {
Expand Down
2 changes: 1 addition & 1 deletion lib/propolis/src/hw/qemu/ramfb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ pin_project! {
since: Instant,
}
}
impl<'a> Future for UpdatedSince<'a> {
impl Future for UpdatedSince<'_> {
type Output = ();

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
Expand Down
2 changes: 1 addition & 1 deletion lib/propolis/src/util/aspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub struct InverseIter<'a, T> {
end: usize,
}

impl<'a, T> Iterator for InverseIter<'a, T> {
impl<T> Iterator for InverseIter<'_, T> {
/// Item represents unregistered region in address mapping.
type Item = Extent;

Expand Down
6 changes: 2 additions & 4 deletions lib/propolis/src/vmm/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,7 @@ impl SubMapping<'_> {
let prot = base.prot;
SubMapping { backing: Backing::Base(base), ptr, len, prot }
}
}

impl<'a> SubMapping<'a> {
/// Acquire a reference to a region of memory within the
/// current mapping.
///
Expand Down Expand Up @@ -1034,7 +1032,7 @@ pub struct MemMany<'a, T: Copy> {
pos: usize,
phantom: PhantomData<T>,
}
impl<'a, T: Copy + FromBytes> GuestData<MemMany<'a, T>> {
impl<T: Copy + FromBytes> GuestData<MemMany<'_, T>> {
/// Gets the object at position `pos` within the memory region.
///
/// Returns [`Option::None`] if out of range.
Expand All @@ -1051,7 +1049,7 @@ impl<'a, T: Copy + FromBytes> GuestData<MemMany<'a, T>> {
}
}
}
impl<'a, T: Copy + FromBytes> Iterator for GuestData<MemMany<'a, T>> {
impl<T: Copy + FromBytes> Iterator for GuestData<MemMany<'_, T>> {
type Item = GuestData<T>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 3 additions & 1 deletion phd-tests/framework/src/test_vm/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ impl PropolisServer {
std::process::Command::new("pfexec")
.args(["kill", &pid.to_string()])
.spawn()
.expect("should be able to kill a phd-spawned propolis");
.expect("should be able to kill a phd-spawned propolis")
.wait()
.expect("kill of phd-spawned propolis was run");

server
.wait()
Expand Down

0 comments on commit 8e5693b

Please sign in to comment.