Skip to content
Merged
Prev Previous commit
Next Next commit
use contains instead of manual check
  • Loading branch information
ntBre committed Nov 26, 2024
commit 530ddd2c10a6c3487f46d4b79d6338fdfb01dfca
6 changes: 5 additions & 1 deletion crates/ruff_linter/src/checkers/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,11 @@ impl<'a> Checker<'a> {

/// Visit an [`Expr`], and treat it as a type definition.
fn visit_type_definition(&mut self, expr: &'a Expr) {
if !(self.semantic.flags & SemanticModelFlags::NO_TYPE_CHECK).is_empty() {
if self
.semantic
.flags
.contains(SemanticModelFlags::NO_TYPE_CHECK)
{
return;
}
let snapshot = self.semantic.flags;
Expand Down