Rollup merge of #139615 - nnethercote:rm-name_or_empty, r=jdonszelmann
Remove `name_or_empty` Another step towards #137978. r? ``@jdonszelmann``
This commit is contained in:
commit
540fb228af
42 changed files with 309 additions and 226 deletions
|
@ -1237,7 +1237,7 @@ impl AttributeExt for Attribute {
|
|||
Attribute::Parsed(AttributeKind::DocComment { kind, comment, .. }) => {
|
||||
Some((*comment, *kind))
|
||||
}
|
||||
Attribute::Unparsed(_) if self.name_or_empty() == sym::doc => {
|
||||
Attribute::Unparsed(_) if self.has_name(sym::doc) => {
|
||||
self.value_str().map(|s| (s, CommentKind::Line))
|
||||
}
|
||||
_ => None,
|
||||
|
@ -1262,8 +1262,8 @@ impl Attribute {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn name_or_empty(&self) -> Symbol {
|
||||
AttributeExt::name_or_empty(self)
|
||||
pub fn name(&self) -> Option<Symbol> {
|
||||
AttributeExt::name(self)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
@ -1301,6 +1301,11 @@ impl Attribute {
|
|||
AttributeExt::has_name(self, name)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn has_any_name(&self, names: &[Symbol]) -> bool {
|
||||
AttributeExt::has_any_name(self, names)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn span(&self) -> Span {
|
||||
AttributeExt::span(self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue