impl Item {
/// Finds the `doc` attribute as a NameValue and returns the corresponding
/// value found.
- pub fn doc_value<'a>(&'a self) -> Option<&'a str> {
+ pub fn doc_value(&self) -> Option<&str> {
self.attrs.doc_value()
}
/// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
pub trait AttributesExt {
/// Finds an attribute as List and returns the list of attributes nested inside.
- fn lists<'a>(&'a self, name: Symbol) -> ListAttributesIter<'a>;
+ fn lists(&self, name: Symbol) -> ListAttributesIter<'_>;
}
impl AttributesExt for [ast::Attribute] {
- fn lists<'a>(&'a self, name: Symbol) -> ListAttributesIter<'a> {
+ fn lists(&self, name: Symbol) -> ListAttributesIter<'_> {
ListAttributesIter {
attrs: self.iter(),
current_list: Vec::new().into_iter(),
/// Finds the `doc` attribute as a NameValue and returns the corresponding
/// value found.
- pub fn doc_value<'a>(&'a self) -> Option<&'a str> {
+ pub fn doc_value(&self) -> Option<&str> {
self.doc_strings.first().map(|s| s.as_str())
}
}
impl AttributesExt for Attributes {
- fn lists<'a>(&'a self, name: Symbol) -> ListAttributesIter<'a> {
+ fn lists(&self, name: Symbol) -> ListAttributesIter<'_> {
self.other_attrs.lists(name)
}
}
MacroKind::Bang => (i, TypeKind::Macro),
MacroKind::Attr => (i, TypeKind::Attr),
MacroKind::Derive => (i, TypeKind::Derive),
- MacroKind::ProcMacroStub => unreachable!(),
},
Res::Def(DefKind::TraitAlias, i) => (i, TypeKind::TraitAlias),
Res::SelfTy(Some(def_id), _) => (def_id, TypeKind::Trait),