Skip to content

Commit

Permalink
misc: Elide needless lifetimes
Browse files Browse the repository at this point in the history
As clippy of rust-toolchain version 1.83.0-beta.1 suggests, elide
needless lifetimes to `'_`.

Signed-off-by: Ruoqing He <[email protected]>
  • Loading branch information
RuoqingHe authored and rbradford committed Oct 18, 2024
1 parent 86315ad commit 0aab960
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions net_util/src/queue_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ impl IovecBuffer {

struct IovecBufferBorrowed<'a>(&'a mut Vec<libc::iovec>);

impl<'a> std::ops::Deref for IovecBufferBorrowed<'a> {
impl std::ops::Deref for IovecBufferBorrowed<'_> {
type Target = Vec<libc::iovec>;

fn deref(&self) -> &Self::Target {
self.0
}
}

impl<'a> std::ops::DerefMut for IovecBufferBorrowed<'a> {
impl std::ops::DerefMut for IovecBufferBorrowed<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.0
}
Expand Down
2 changes: 1 addition & 1 deletion pci/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct PciBdf(u32);

struct PciBdfVisitor;

impl<'de> Visitor<'de> for PciBdfVisitor {
impl Visitor<'_> for PciBdfVisitor {
type Value = PciBdf;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/ch-remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ impl<'a> DBusApi1ProxyBlocking<'a> {
}
}

impl<'a> TargetApi<'a> {
impl TargetApi<'_> {
fn do_command(&mut self, matches: &ArgMatches) -> ApiResult {
match self {
Self::HttpApi(api_socket, _) => rest_api_do_command(matches, api_socket),
Expand Down
2 changes: 1 addition & 1 deletion virtio-devices/src/vsock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ mod tests {
pub guest_evvq: GuestQ<'a>,
}

impl<'a> EpollHandlerContext<'a> {
impl EpollHandlerContext<'_> {
pub fn signal_txq_event(&mut self) {
self.handler.queue_evts[1].write(1).unwrap();
let events = epoll::Events::EPOLLIN;
Expand Down
2 changes: 1 addition & 1 deletion vmm/src/device_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<'a> Iterator for BftIter<'a> {
}
}

impl<'a> DoubleEndedIterator for BftIter<'a> {
impl DoubleEndedIterator for BftIter<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
self.nodes.pop()
}
Expand Down

0 comments on commit 0aab960

Please sign in to comment.