Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
  • Loading branch information
WaffleLapkin and Veykril committed Dec 21, 2022
1 parent 608dc49 commit bb3a66b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/hir/src/semantics.rs
Expand Up @@ -1495,11 +1495,10 @@ impl<'db> SemanticsImpl<'db> {
Either::Right(it) => self.to_def(it).map(<_>::into).map(DefWithBodyId::VariantId),
};
let Some(def) = def else { return false };
let enclosing_node = enclosing_item.as_ref().either(|i| i.syntax(), |v| v.syntax());

if ast::Fn::cast(enclosing_node.clone()).and_then(|f| f.unsafe_token()).is_some() {
if matches!(&enclosing_item, Either::Left(ast::Item::Fn(it)) if f.unsafe_token().is_some()) {
return true;
}
let enclosing_node = enclosing_item.as_ref().either(|i| i.syntax(), |v| v.syntax());

let (body, source_map) = self.db.body_with_source_map(def);

Expand Down

0 comments on commit bb3a66b

Please sign in to comment.