8899: minor: Simplify r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot] 2021-05-20 18:09:12 +00:00 committed by GitHub
commit 9b94a27813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -384,7 +384,7 @@ impl DefCollector<'_> {
if let MacroDirectiveKind::Attr { ast_id, mod_item, attr } = &directive.kind {
self.ignore_attrs_on.insert(ast_id.ast_id.with_value(*mod_item), *attr);
let file_id = self.def_map[directive.module_id].definition_source(self.db).file_id;
let file_id = ast_id.ast_id.file_id;
let item_tree = self.db.file_item_tree(file_id);
let mod_dir = self.mod_dirs[&directive.module_id].clone();
ModCollector {
@ -938,9 +938,7 @@ impl DefCollector<'_> {
// Resolved to derive helper. Collect the item's attributes again,
// starting after the derive helper.
let file_id = self.def_map[directive.module_id]
.definition_source(self.db)
.file_id;
let file_id = ast_id.ast_id.file_id;
let item_tree = self.db.file_item_tree(file_id);
let mod_dir = self.mod_dirs[&directive.module_id].clone();
self.ignore_attrs_on.insert(InFile::new(file_id, *mod_item), *attr);