mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
remove unnecessary lifetimes that can be elided
This commit is contained in:
parent
8615bba105
commit
4f8ffd0ba4
11 changed files with 49 additions and 63 deletions
|
|
@ -96,7 +96,7 @@ pub(crate) enum BuiltinShadowMode {
|
|||
/// Legacy macros can only be accessed through special methods like `get_legacy_macros`.
|
||||
/// Other methods will only resolve values, types and module scoped macros only.
|
||||
impl ItemScope {
|
||||
pub fn entries<'a>(&'a self) -> impl Iterator<Item = (&'a Name, PerNs)> + 'a {
|
||||
pub fn entries(&self) -> impl Iterator<Item = (&Name, PerNs)> + '_ {
|
||||
// FIXME: shadowing
|
||||
self.types
|
||||
.keys()
|
||||
|
|
@ -169,7 +169,7 @@ impl ItemScope {
|
|||
iter.find_map(|(name, &(other_def, vis))| (other_def == def).then_some((name, vis)))
|
||||
}
|
||||
|
||||
pub(crate) fn traits<'a>(&'a self) -> impl Iterator<Item = TraitId> + 'a {
|
||||
pub(crate) fn traits(&self) -> impl Iterator<Item = TraitId> + '_ {
|
||||
self.types
|
||||
.values()
|
||||
.filter_map(|&(def, _)| match def {
|
||||
|
|
@ -326,7 +326,7 @@ impl ItemScope {
|
|||
changed
|
||||
}
|
||||
|
||||
pub(crate) fn resolutions<'a>(&'a self) -> impl Iterator<Item = (Option<Name>, PerNs)> + 'a {
|
||||
pub(crate) fn resolutions(&self) -> impl Iterator<Item = (Option<Name>, PerNs)> + '_ {
|
||||
self.entries().map(|(name, res)| (Some(name.clone()), res)).chain(
|
||||
self.unnamed_trait_imports
|
||||
.iter()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue