fix: Simplify macro statement expansion handling

This commit is contained in:
Lukas Wirth 2022-07-01 14:43:57 +02:00
parent f8c416e1b9
commit 531e152390
10 changed files with 155 additions and 110 deletions

View file

@ -2223,6 +2223,7 @@ impl Local {
let src = source_map.pat_syntax(self.pat_id).unwrap(); // Hmm...
let root = src.file_syntax(db.upcast());
src.map(|ast| match ast {
// Suspicious unwrap
Either::Left(it) => Either::Left(it.cast().unwrap().to_node(&root)),
Either::Right(it) => Either::Right(it.to_node(&root)),
})