Skip to content

Commit

Permalink
Fix elided_named_lifetimes in code
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Aug 31, 2024
1 parent 5d04472 commit f7b0b22
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ impl<'b> Pattern for &'b String {
}

#[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
Self::Searcher<'a>: core::str::pattern::ReverseSearcher<'a>,
{
Expand Down
20 changes: 10 additions & 10 deletions library/core/src/fmt/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,43 +110,43 @@ impl<'a> Argument<'a> {
}

#[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)
}
#[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)
}
#[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(()))
}
#[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)
}
#[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)
}
#[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)
}
#[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)
}
#[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)
}
#[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)
}
#[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)
}
#[inline(always)]
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rust-analyzer/crates/hir-def/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ 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 }
}

Expand Down Expand Up @@ -594,7 +594,7 @@ impl<'attr> AttrQuery<'attr> {
/// #[doc(html_root_url = "url")]
/// ^^^^^^^^^^^^^ 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| {
let name = tt.token_trees.iter()
.skip_while(|tt| !matches!(tt, tt::TokenTree::Leaf(tt::Leaf::Ident(tt::Ident { sym, ..} )) if *sym == *key))
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/hir-def/src/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Body {
pub fn blocks<'a>(
&'a self,
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)))
}

Expand Down

0 comments on commit f7b0b22

Please sign in to comment.