elide lifetimes where possible
This is possible on newer rustc. Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
parent
4cb3579786
commit
3492a0cee5
@ -935,7 +935,7 @@ fn serialize_input_schema(
|
|||||||
|
|
||||||
struct DefaultParameters<'a>(&'a 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) {
|
fn visit_expr_mut(&mut self, i: &mut syn::Expr) {
|
||||||
if let syn::Expr::Macro(exprmac) = i {
|
if let syn::Expr::Macro(exprmac) = i {
|
||||||
if exprmac.mac.path.is_ident("api_get_default") {
|
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> {
|
fn get_default(&self, param_tokens: TokenStream) -> Result<syn::Expr, syn::Error> {
|
||||||
let param_name: syn::LitStr = syn::parse2(param_tokens)?;
|
let param_name: syn::LitStr = syn::parse2(param_tokens)?;
|
||||||
match self.0.find_obj_property_by_ident(¶m_name.value()) {
|
match self.0.find_obj_property_by_ident(¶m_name.value()) {
|
||||||
|
@ -689,7 +689,7 @@ pub struct DerivedItems<'a> {
|
|||||||
attributes: std::slice::Iter<'a, syn::Attribute>,
|
attributes: std::slice::Iter<'a, syn::Attribute>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Iterator for DerivedItems<'a> {
|
impl Iterator for DerivedItems<'_> {
|
||||||
type Item = syn::Path;
|
type Item = syn::Path;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
|
@ -234,7 +234,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'c, C> HttpApiClient for &'c C
|
impl<C> HttpApiClient for &C
|
||||||
where
|
where
|
||||||
C: HttpApiClient,
|
C: HttpApiClient,
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ pub struct ZstdEncoder<'a, T> {
|
|||||||
state: EncoderState,
|
state: EncoderState,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T, O, E> ZstdEncoder<'a, T>
|
impl<T, O, E> ZstdEncoder<'_, T>
|
||||||
where
|
where
|
||||||
T: Stream<Item = Result<O, E>> + Unpin,
|
T: Stream<Item = Result<O, E>> + Unpin,
|
||||||
O: Into<Bytes>,
|
O: Into<Bytes>,
|
||||||
@ -55,7 +55,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> ZstdEncoder<'a, T> {
|
impl<T> ZstdEncoder<'_, T> {
|
||||||
/// Returns the wrapped [Stream]
|
/// Returns the wrapped [Stream]
|
||||||
pub fn into_inner(self) -> T {
|
pub fn into_inner(self) -> T {
|
||||||
self.inner
|
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
|
where
|
||||||
T: Stream<Item = Result<O, E>> + Unpin,
|
T: Stream<Item = Result<O, E>> + Unpin,
|
||||||
O: Into<Bytes>,
|
O: Into<Bytes>,
|
||||||
|
@ -392,7 +392,7 @@ enum FilterElement<'a> {
|
|||||||
Verbatim(&'a str),
|
Verbatim(&'a str),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Display for FilterElement<'a> {
|
impl Display for FilterElement<'_> {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
fn write_children(f: &mut Formatter<'_>, children: &[FilterElement]) -> std::fmt::Result {
|
fn write_children(f: &mut Formatter<'_>, children: &[FilterElement]) -> std::fmt::Result {
|
||||||
for child in children {
|
for child in children {
|
||||||
|
@ -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;
|
type Error = Error;
|
||||||
|
|
||||||
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, 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;
|
type Error = Error;
|
||||||
|
|
||||||
fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, 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;
|
type Error = Error;
|
||||||
|
|
||||||
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, 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;
|
type Error = Error;
|
||||||
|
|
||||||
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Error>
|
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Error>
|
||||||
|
@ -12,7 +12,7 @@ pub struct NoSchemaDeserializer<'de, 'i> {
|
|||||||
input: Cow3<'de, 'i, str>,
|
input: Cow3<'de, 'i, str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'de, 'i> NoSchemaDeserializer<'de, 'i> {
|
impl<'de> NoSchemaDeserializer<'de, '_> {
|
||||||
pub fn new<T>(input: T) -> Self
|
pub fn new<T>(input: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<Cow<'de, str>>,
|
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;
|
type Error = Error;
|
||||||
|
|
||||||
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, 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;
|
type Error = Error;
|
||||||
|
|
||||||
fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Error>
|
fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Error>
|
||||||
|
@ -85,7 +85,7 @@ pub(crate) fn next_property(mut data: &str) -> Option<Result<NextProperty, Error
|
|||||||
Some(Ok((key, value, data)))
|
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.
|
/// Parse a quoted string and move `data` to after the closing quote.
|
||||||
///
|
///
|
||||||
|
@ -123,7 +123,7 @@ impl<'de> serde::Deserialize<'de> for UPID {
|
|||||||
{
|
{
|
||||||
struct ForwardToStrVisitor;
|
struct ForwardToStrVisitor;
|
||||||
|
|
||||||
impl<'a> serde::de::Visitor<'a> for ForwardToStrVisitor {
|
impl serde::de::Visitor<'_> for ForwardToStrVisitor {
|
||||||
type Value = UPID;
|
type Value = UPID;
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
|
@ -71,7 +71,7 @@ struct Attachment<'a> {
|
|||||||
content: &'a [u8],
|
content: &'a [u8],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Attachment<'a> {
|
impl Attachment<'_> {
|
||||||
fn format_attachment(&self, file_boundary: &str) -> String {
|
fn format_attachment(&self, file_boundary: &str) -> String {
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ pub struct ACLEntry<'a> {
|
|||||||
_phantom: PhantomData<&'a mut ()>,
|
_phantom: PhantomData<&'a mut ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> ACLEntry<'a> {
|
impl ACLEntry<'_> {
|
||||||
pub fn get_tag_type(&self) -> Result<ACLTag, nix::errno::Errno> {
|
pub fn get_tag_type(&self) -> Result<ACLTag, nix::errno::Errno> {
|
||||||
let mut tag = ACL_UNDEFINED_TAG;
|
let mut tag = ACL_UNDEFINED_TAG;
|
||||||
let res = unsafe { acl_get_tag_type(self.ptr, &mut tag as *mut ACLTag) };
|
let res = unsafe { acl_get_tag_type(self.ptr, &mut tag as *mut ACLTag) };
|
||||||
|
@ -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
|
/// Note that we may consider changing this so `get_origin` returns the `Host:` header provided by
|
||||||
/// the connecting client.
|
/// the connecting client.
|
||||||
impl<'a> webauthn_rs::WebauthnConfig for WebauthnConfigInstance<'a> {
|
impl webauthn_rs::WebauthnConfig for WebauthnConfigInstance<'_> {
|
||||||
fn get_relying_party_name(&self) -> &str {
|
fn get_relying_party_name(&self) -> &str {
|
||||||
self.rp
|
self.rp
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ impl<'de> serde::Deserialize<'de> for Uuid {
|
|||||||
|
|
||||||
struct ForwardToStrVisitor;
|
struct ForwardToStrVisitor;
|
||||||
|
|
||||||
impl<'a> serde::de::Visitor<'a> for ForwardToStrVisitor {
|
impl serde::de::Visitor<'_> for ForwardToStrVisitor {
|
||||||
type Value = Uuid;
|
type Value = Uuid;
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user