Skip to content

Commit b25564f

Browse files
committed
name -> ident_str
1 parent e63a685 commit b25564f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

clippy_lints/src/attrs.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ impl LintPass for AttrPass {
208208
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
209209
fn check_attribute(&mut self, cx: &LateContext<'a, 'tcx>, attr: &'tcx Attribute) {
210210
if let Some(items) = &attr.meta_item_list() {
211-
match &*attr.name().as_str() {
211+
if let Some(ident) = attr.ident_str() {
212+
match ident {
212213
"allow" | "warn" | "deny" | "forbid" => {
213214
check_clippy_lint_names(cx, items);
214215
},
@@ -229,6 +230,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
229230
}
230231
}
231232
}
233+
}
232234

233235
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
234236
if is_relevant_item(cx.tcx, item) {
@@ -240,7 +242,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
240242

241243
for attr in &item.attrs {
242244
if let Some(lint_list) = &attr.meta_item_list() {
243-
match &*attr.name().as_str() {
245+
if let Some(ident) = attr.ident_str() {
246+
match ident {
244247
"allow" | "warn" | "deny" | "forbid" => {
245248
// whitelist `unused_imports` and `deprecated` for `use` items
246249
// and `unused_imports` for `extern crate` items with `macro_use`
@@ -288,6 +291,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
288291
}
289292
}
290293
}
294+
}
291295
},
292296
_ => {},
293297
}

clippy_lints/src/missing_doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl MissingDoc {
5858
if let Some(meta) = meta;
5959
if let MetaItemKind::List(list) = meta.node;
6060
if let Some(meta) = list.get(0);
61-
if let Some(name) = meta.name();
61+
if let Some(name) = meta.ident_str();
6262
then {
6363
name == "include"
6464
} else {

0 commit comments

Comments
 (0)