NestedMetaItemKind -> NestedMetaItem

This commit is contained in:
Mateusz Mikuła 2019-03-18 11:59:09 +01:00 committed by Mateusz Mikuła
parent cf71caa71d
commit e63a685412
2 changed files with 5 additions and 5 deletions

View file

@ -14,7 +14,7 @@ use rustc::ty::{self, TyCtxt};
use rustc::{declare_tool_lint, lint_array};
use rustc_errors::Applicability;
use semver::Version;
use syntax::ast::{AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem, NestedMetaItemKind};
use syntax::ast::{AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem};
use syntax::source_map::Span;
declare_clippy_lint! {
@ -219,7 +219,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
}
for item in items {
if_chain! {
if let NestedMetaItemKind::MetaItem(mi) = &item.node;
if let NestedMetaItem::MetaItem(mi) = &item;
if let MetaItemKind::NameValue(lit) = &mi.node;
if mi.name() == "since";
then {
@ -476,7 +476,7 @@ fn check_semver(cx: &LateContext<'_, '_>, span: Span, lit: &Lit) {
}
fn is_word(nmi: &NestedMetaItem, expected: &str) -> bool {
if let NestedMetaItemKind::MetaItem(mi) = &nmi.node {
if let NestedMetaItem::MetaItem(mi) = &nmi {
mi.is_word() && mi.name() == expected
} else {
false

View file

@ -12,9 +12,9 @@ use toml;
/// Gets the configuration file from arguments.
pub fn file_from_args(
args: &[source_map::Spanned<ast::NestedMetaItemKind>],
args: &[ast::NestedMetaItem],
) -> Result<Option<path::PathBuf>, (&'static str, source_map::Span)> {
for arg in args.iter().filter_map(syntax::source_map::Spanned::meta_item) {
for arg in args.iter().filter_map(syntax::ast::NestedMetaItem::meta_item) {
if arg.name() == "conf_file" {
return match arg.node {
ast::MetaItemKind::Word | ast::MetaItemKind::List(_) => {