Tweak check_doc_keyword
.
To use one `kw::Empty` instead of two. It's a little more direct this way, and avoids `kw::Empty` being used for both "no string" and "empty string".
This commit is contained in:
parent
a6a6d01bbc
commit
9fb0defa52
1 changed files with 5 additions and 5 deletions
|
@ -1041,11 +1041,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
||||||
s <= kw::Union || s == sym::SelfTy
|
s <= kw::Union || s == sym::SelfTy
|
||||||
}
|
}
|
||||||
|
|
||||||
let doc_keyword = meta.value_str().unwrap_or(kw::Empty);
|
let doc_keyword = match meta.value_str() {
|
||||||
if doc_keyword == kw::Empty {
|
Some(value) if value != kw::Empty => value,
|
||||||
self.doc_attr_str_error(meta, "keyword");
|
_ => return self.doc_attr_str_error(meta, "keyword"),
|
||||||
return;
|
};
|
||||||
}
|
|
||||||
let item_kind = match self.tcx.hir_node(hir_id) {
|
let item_kind = match self.tcx.hir_node(hir_id) {
|
||||||
hir::Node::Item(item) => Some(&item.kind),
|
hir::Node::Item(item) => Some(&item.kind),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue