From 209263eb93a439ce4574653603a682b6159d3062 Mon Sep 17 00:00:00 2001 From: Gwen Lg Date: Sat, 13 Dec 2025 17:40:06 +0100 Subject: [PATCH] style: adjust specified lifetime in code - include the lifetime instead of hide it lint message: hiding a lifetime that's elided elsewhere is confusing help: the same lifetime is referred to in inconsistent ways, making the signature confusing - remove useless lifetime lint message: the following explicit lifetimes could be elided: 'a help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#needless_lifetimes --- src/garage/cli/remote/layout.rs | 4 ++-- src/k2v-client/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/garage/cli/remote/layout.rs b/src/garage/cli/remote/layout.rs index e243688b..1872f63e 100644 --- a/src/garage/cli/remote/layout.rs +++ b/src/garage/cli/remote/layout.rs @@ -344,10 +344,10 @@ pub fn get_staged_or_current_role( None } -pub fn find_matching_node<'a>( +pub fn find_matching_node( status: &GetClusterStatusResponse, layout: &GetClusterLayoutResponse, - pattern: &'a str, + pattern: &str, ) -> Result { let all_node_ids_iter = status .nodes diff --git a/src/k2v-client/lib.rs b/src/k2v-client/lib.rs index fe8fd3e0..a5485cf9 100644 --- a/src/k2v-client/lib.rs +++ b/src/k2v-client/lib.rs @@ -647,7 +647,7 @@ struct PollRangeResponse { } impl<'a> Filter<'a> { - fn query_params(&self) -> Vec<(&'static str, std::borrow::Cow)> { + fn query_params(&self) -> Vec<(&'static str, std::borrow::Cow<'_, str>)> { let mut res = Vec::<(&'static str, std::borrow::Cow)>::with_capacity(8); if let Some(start) = self.start.as_deref() { res.push(("start", start.into()));