]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/utils/conf.rs
Merge branch 'master' into fix-4727
[rust.git] / clippy_lints / src / utils / conf.rs
index 0c5db79dfd877ca218659a6edcbde246cb22a628..734b689ab1a6cebb54f4599764682b2f732846e2 100644 (file)
 pub fn file_from_args(args: &[ast::NestedMetaItem]) -> Result<Option<path::PathBuf>, (&'static str, source_map::Span)> {
     for arg in args.iter().filter_map(syntax::ast::NestedMetaItem::meta_item) {
         if arg.check_name(sym!(conf_file)) {
-            return match arg.node {
+            return match arg.kind {
                 ast::MetaItemKind::Word | ast::MetaItemKind::List(_) => {
                     Err(("`conf_file` must be a named value", arg.span))
                 },
                 ast::MetaItemKind::NameValue(ref value) => {
-                    if let ast::LitKind::Str(ref file, _) = value.node {
+                    if let ast::LitKind::Str(ref file, _) = value.kind {
                         Ok(Some(file.to_string().into()))
                     } else {
                         Err(("`conf_file` value must be a string", value.span))
@@ -90,6 +90,7 @@ mod $rust_name {
                     }
                 }
 
+                #[must_use]
                 fn $rust_name() -> define_Conf!(TY $($ty)+) {
                     define_Conf!(DEFAULT $($ty)+, $default)
                 }
@@ -153,6 +154,7 @@ fn $rust_name() -> define_Conf!(TY $($ty)+) {
 }
 
 impl Default for Conf {
+    #[must_use]
     fn default() -> Self {
         toml::from_str("").expect("we never error on empty config files")
     }