Fix elided_named_lifetimes in code

This commit is contained in:
Pavel Grigorenko 2024-08-17 23:47:37 +03:00
parent 5d04472461
commit f7b0b22137
4 changed files with 14 additions and 14 deletions

View File

@ -2313,7 +2313,7 @@ fn is_suffix_of<'a>(self, haystack: &'a str) -> bool
} }
#[inline] #[inline]
fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&str> fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&'a str>
where where
Self::Searcher<'a>: core::str::pattern::ReverseSearcher<'a>, Self::Searcher<'a>: core::str::pattern::ReverseSearcher<'a>,
{ {

View File

@ -110,43 +110,43 @@ fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> Argument<'b>
} }
#[inline(always)] #[inline(always)]
pub fn new_display<'b, T: Display>(x: &'b T) -> Argument<'_> { pub fn new_display<'b, T: Display>(x: &'b T) -> Argument<'b> {
Self::new(x, Display::fmt) Self::new(x, Display::fmt)
} }
#[inline(always)] #[inline(always)]
pub fn new_debug<'b, T: Debug>(x: &'b T) -> Argument<'_> { pub fn new_debug<'b, T: Debug>(x: &'b T) -> Argument<'b> {
Self::new(x, Debug::fmt) Self::new(x, Debug::fmt)
} }
#[inline(always)] #[inline(always)]
pub fn new_debug_noop<'b, T: Debug>(x: &'b T) -> Argument<'_> { pub fn new_debug_noop<'b, T: Debug>(x: &'b T) -> Argument<'b> {
Self::new(x, |_, _| Ok(())) Self::new(x, |_, _| Ok(()))
} }
#[inline(always)] #[inline(always)]
pub fn new_octal<'b, T: Octal>(x: &'b T) -> Argument<'_> { pub fn new_octal<'b, T: Octal>(x: &'b T) -> Argument<'b> {
Self::new(x, Octal::fmt) Self::new(x, Octal::fmt)
} }
#[inline(always)] #[inline(always)]
pub fn new_lower_hex<'b, T: LowerHex>(x: &'b T) -> Argument<'_> { pub fn new_lower_hex<'b, T: LowerHex>(x: &'b T) -> Argument<'b> {
Self::new(x, LowerHex::fmt) Self::new(x, LowerHex::fmt)
} }
#[inline(always)] #[inline(always)]
pub fn new_upper_hex<'b, T: UpperHex>(x: &'b T) -> Argument<'_> { pub fn new_upper_hex<'b, T: UpperHex>(x: &'b T) -> Argument<'b> {
Self::new(x, UpperHex::fmt) Self::new(x, UpperHex::fmt)
} }
#[inline(always)] #[inline(always)]
pub fn new_pointer<'b, T: Pointer>(x: &'b T) -> Argument<'_> { pub fn new_pointer<'b, T: Pointer>(x: &'b T) -> Argument<'b> {
Self::new(x, Pointer::fmt) Self::new(x, Pointer::fmt)
} }
#[inline(always)] #[inline(always)]
pub fn new_binary<'b, T: Binary>(x: &'b T) -> Argument<'_> { pub fn new_binary<'b, T: Binary>(x: &'b T) -> Argument<'b> {
Self::new(x, Binary::fmt) Self::new(x, Binary::fmt)
} }
#[inline(always)] #[inline(always)]
pub fn new_lower_exp<'b, T: LowerExp>(x: &'b T) -> Argument<'_> { pub fn new_lower_exp<'b, T: LowerExp>(x: &'b T) -> Argument<'b> {
Self::new(x, LowerExp::fmt) Self::new(x, LowerExp::fmt)
} }
#[inline(always)] #[inline(always)]
pub fn new_upper_exp<'b, T: UpperExp>(x: &'b T) -> Argument<'_> { pub fn new_upper_exp<'b, T: UpperExp>(x: &'b T) -> Argument<'b> {
Self::new(x, UpperExp::fmt) Self::new(x, UpperExp::fmt)
} }
#[inline(always)] #[inline(always)]

View File

@ -117,7 +117,7 @@ pub(crate) fn fields_attrs_query(
} }
impl Attrs { impl Attrs {
pub fn by_key<'attrs>(&'attrs self, key: &'attrs Symbol) -> AttrQuery<'_> { pub fn by_key<'attrs>(&'attrs self, key: &'attrs Symbol) -> AttrQuery<'attrs> {
AttrQuery { attrs: self, key } AttrQuery { attrs: self, key }
} }
@ -594,7 +594,7 @@ pub fn attrs(self) -> impl Iterator<Item = &'attr Attr> + Clone {
/// #[doc(html_root_url = "url")] /// #[doc(html_root_url = "url")]
/// ^^^^^^^^^^^^^ key /// ^^^^^^^^^^^^^ key
/// ``` /// ```
pub fn find_string_value_in_tt(self, key: &'attr Symbol) -> Option<&str> { pub fn find_string_value_in_tt(self, key: &'attr Symbol) -> Option<&'attr str> {
self.tt_values().find_map(|tt| { self.tt_values().find_map(|tt| {
let name = tt.token_trees.iter() let name = tt.token_trees.iter()
.skip_while(|tt| !matches!(tt, tt::TokenTree::Leaf(tt::Leaf::Ident(tt::Ident { sym, ..} )) if *sym == *key)) .skip_while(|tt| !matches!(tt, tt::TokenTree::Leaf(tt::Leaf::Ident(tt::Ident { sym, ..} )) if *sym == *key))

View File

@ -197,7 +197,7 @@ pub(crate) fn body_query(db: &dyn DefDatabase, def: DefWithBodyId) -> Arc<Body>
pub fn blocks<'a>( pub fn blocks<'a>(
&'a self, &'a self,
db: &'a dyn DefDatabase, db: &'a dyn DefDatabase,
) -> impl Iterator<Item = (BlockId, Arc<DefMap>)> + '_ { ) -> impl Iterator<Item = (BlockId, Arc<DefMap>)> + 'a {
self.block_scopes.iter().map(move |&block| (block, db.block_def_map(block))) self.block_scopes.iter().map(move |&block| (block, db.block_def_map(block)))
} }