elide lifetimes where possible

This is possible on newer rustc.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
Maximiliano Sandoval 2024-12-03 11:20:34 +01:00 committed by Fabian Grünbichler
parent 4cb3579786
commit 3492a0cee5
13 changed files with 21 additions and 21 deletions

View File

@ -935,7 +935,7 @@ fn serialize_input_schema(
struct DefaultParameters<'a>(&'a Schema);
impl<'a> VisitMut for DefaultParameters<'a> {
impl VisitMut for DefaultParameters<'_> {
fn visit_expr_mut(&mut self, i: &mut syn::Expr) {
if let syn::Expr::Macro(exprmac) = i {
if exprmac.mac.path.is_ident("api_get_default") {
@ -955,7 +955,7 @@ impl<'a> VisitMut for DefaultParameters<'a> {
}
}
impl<'a> DefaultParameters<'a> {
impl DefaultParameters<'_> {
fn get_default(&self, param_tokens: TokenStream) -> Result<syn::Expr, syn::Error> {
let param_name: syn::LitStr = syn::parse2(param_tokens)?;
match self.0.find_obj_property_by_ident(&param_name.value()) {

View File

@ -689,7 +689,7 @@ pub struct DerivedItems<'a> {
attributes: std::slice::Iter<'a, syn::Attribute>,
}
impl<'a> Iterator for DerivedItems<'a> {
impl Iterator for DerivedItems<'_> {
type Item = syn::Path;
fn next(&mut self) -> Option<Self::Item> {

View File

@ -234,7 +234,7 @@ where
}
}
impl<'c, C> HttpApiClient for &'c C
impl<C> HttpApiClient for &C
where
C: HttpApiClient,
{

View File

@ -32,7 +32,7 @@ pub struct ZstdEncoder<'a, T> {
state: EncoderState,
}
impl<'a, T, O, E> ZstdEncoder<'a, T>
impl<T, O, E> ZstdEncoder<'_, T>
where
T: Stream<Item = Result<O, E>> + Unpin,
O: Into<Bytes>,
@ -55,7 +55,7 @@ where
}
}
impl<'a, T> ZstdEncoder<'a, T> {
impl<T> ZstdEncoder<'_, T> {
/// Returns the wrapped [Stream]
pub fn into_inner(self) -> T {
self.inner
@ -80,7 +80,7 @@ impl<'a, T> ZstdEncoder<'a, T> {
}
}
impl<'a, T, O, E> Stream for ZstdEncoder<'a, T>
impl<T, O, E> Stream for ZstdEncoder<'_, T>
where
T: Stream<Item = Result<O, E>> + Unpin,
O: Into<Bytes>,

View File

@ -392,7 +392,7 @@ enum FilterElement<'a> {
Verbatim(&'a str),
}
impl<'a> Display for FilterElement<'a> {
impl Display for FilterElement<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
fn write_children(f: &mut Formatter<'_>, children: &[FilterElement]) -> std::fmt::Result {
for child in children {

View File

@ -155,7 +155,7 @@ impl<'de, 'i> SchemaDeserializer<'de, 'i> {
}
}
impl<'de, 'i> de::Deserializer<'de> for SchemaDeserializer<'de, 'i> {
impl<'de> de::Deserializer<'de> for SchemaDeserializer<'de, '_> {
type Error = Error;
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
@ -410,7 +410,7 @@ impl<'o, 'i, 's> SeqAccess<'o, 'i, 's> {
}
}
impl<'de, 'i, 's> de::SeqAccess<'de> for SeqAccess<'de, 'i, 's> {
impl<'de> de::SeqAccess<'de> for SeqAccess<'de, '_, '_> {
type Error = Error;
fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Error>
@ -448,7 +448,7 @@ impl<'de, 'i, 's> de::SeqAccess<'de> for SeqAccess<'de, 'i, 's> {
}
}
impl<'de, 'i, 's> de::Deserializer<'de> for SeqAccess<'de, 'i, 's> {
impl<'de> de::Deserializer<'de> for SeqAccess<'de, '_, '_> {
type Error = Error;
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
@ -538,7 +538,7 @@ impl<'de, 'i> MapAccess<'de, 'i> {
}
}
impl<'de, 'i> de::MapAccess<'de> for MapAccess<'de, 'i> {
impl<'de> de::MapAccess<'de> for MapAccess<'de, '_> {
type Error = Error;
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Error>

View File

@ -12,7 +12,7 @@ pub struct NoSchemaDeserializer<'de, 'i> {
input: Cow3<'de, 'i, str>,
}
impl<'de, 'i> NoSchemaDeserializer<'de, 'i> {
impl<'de> NoSchemaDeserializer<'de, '_> {
pub fn new<T>(input: T) -> Self
where
T: Into<Cow<'de, str>>,
@ -35,7 +35,7 @@ macro_rules! deserialize_num {
)*}
}
impl<'de, 'i> de::Deserializer<'de> for NoSchemaDeserializer<'de, 'i> {
impl<'de> de::Deserializer<'de> for NoSchemaDeserializer<'de, '_> {
type Error = Error;
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
@ -264,7 +264,7 @@ impl<'de, 'i> SimpleSeqAccess<'de, 'i> {
}
}
impl<'de, 'i> de::SeqAccess<'de> for SimpleSeqAccess<'de, 'i> {
impl<'de> de::SeqAccess<'de> for SimpleSeqAccess<'de, '_> {
type Error = Error;
fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Error>

View File

@ -85,7 +85,7 @@ pub(crate) fn next_property(mut data: &str) -> Option<Result<NextProperty, Error
Some(Ok((key, value, data)))
}
impl<'a> std::iter::FusedIterator for PropertyIterator<'a> {}
impl std::iter::FusedIterator for PropertyIterator<'_> {}
/// Parse a quoted string and move `data` to after the closing quote.
///

View File

@ -123,7 +123,7 @@ impl<'de> serde::Deserialize<'de> for UPID {
{
struct ForwardToStrVisitor;
impl<'a> serde::de::Visitor<'a> for ForwardToStrVisitor {
impl serde::de::Visitor<'_> for ForwardToStrVisitor {
type Value = UPID;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {

View File

@ -71,7 +71,7 @@ struct Attachment<'a> {
content: &'a [u8],
}
impl<'a> Attachment<'a> {
impl Attachment<'_> {
fn format_attachment(&self, file_boundary: &str) -> String {
use std::fmt::Write;

View File

@ -178,7 +178,7 @@ pub struct ACLEntry<'a> {
_phantom: PhantomData<&'a mut ()>,
}
impl<'a> ACLEntry<'a> {
impl ACLEntry<'_> {
pub fn get_tag_type(&self) -> Result<ACLTag, nix::errno::Errno> {
let mut tag = ACL_UNDEFINED_TAG;
let res = unsafe { acl_get_tag_type(self.ptr, &mut tag as *mut ACLTag) };

View File

@ -123,7 +123,7 @@ pub(super) struct WebauthnConfigInstance<'a> {
///
/// Note that we may consider changing this so `get_origin` returns the `Host:` header provided by
/// the connecting client.
impl<'a> webauthn_rs::WebauthnConfig for WebauthnConfigInstance<'a> {
impl webauthn_rs::WebauthnConfig for WebauthnConfigInstance<'_> {
fn get_relying_party_name(&self) -> &str {
self.rp
}

View File

@ -201,7 +201,7 @@ impl<'de> serde::Deserialize<'de> for Uuid {
struct ForwardToStrVisitor;
impl<'a> serde::de::Visitor<'a> for ForwardToStrVisitor {
impl serde::de::Visitor<'_> for ForwardToStrVisitor {
type Value = Uuid;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {