]> git.lizzy.rs Git - rust.git/blobdiff - crates/ra_hir/src/nameres/raw.rs
Fix API of Attr
[rust.git] / crates / ra_hir / src / nameres / raw.rs
index c494b95b0e9c36d5a31395b4d9bf662eb222bcae..0e27dd2db318cfe610471a0dc3ba0ed3c2ac44b2 100644 (file)
@@ -353,8 +353,7 @@ fn add_macro(&mut self, current_module: Option<Module>, m: ast::MacroCall) {
 
         let name = m.name().map(|it| it.as_name());
         let ast_id = self.source_ast_id_map.ast_id(&m);
-        let export = m.has_atom_attr("macro_export")
-            || m.attrs().filter_map(|x| x.as_call()).any(|(name, _)| name == "macro_export");
+        let export = m.attrs().filter_map(|x| x.simple_name()).any(|name| name == "macro_export");
 
         let m = self.raw_items.macros.alloc(MacroData { ast_id, path, name, export });
         self.push_item(current_module, RawItem::Macro(m));
@@ -385,7 +384,7 @@ fn push_item(&mut self, current_module: Option<Module>, item: RawItem) {
 
 fn extract_mod_path_attribute(module: &ast::Module) -> Option<SmolStr> {
     module.attrs().into_iter().find_map(|attr| {
-        attr.as_key_value().and_then(|(name, value)| {
+        attr.as_simple_key_value().and_then(|(name, value)| {
             let is_path = name == "path";
             if is_path {
                 Some(value)