diff --git a/rust/src/import_parsing.rs b/rust/src/import_parsing.rs index ba9d79e0..bf21a9eb 100644 --- a/rust/src/import_parsing.rs +++ b/rust/src/import_parsing.rs @@ -127,14 +127,10 @@ impl<'a> StatementVisitor<'a> for Visitor<'a> { walk_stmt(self, stmt); } } - Expr::Attribute(expr) => { - if expr.attr.id == "TYPE_CHECKING" { - self.typechecking_only = true; - walk_stmt(self, stmt); - self.typechecking_only = false; - } else { - walk_stmt(self, stmt); - } + Expr::Attribute(expr) if expr.attr.id == "TYPE_CHECKING" => { + self.typechecking_only = true; + walk_stmt(self, stmt); + self.typechecking_only = false; } _ => { walk_stmt(self, stmt); diff --git a/tests/adaptors/filesystem.py b/tests/adaptors/filesystem.py index db471f68..73b85ffa 100644 --- a/tests/adaptors/filesystem.py +++ b/tests/adaptors/filesystem.py @@ -48,8 +48,8 @@ def __init__( """ self.contents = self._parse_contents(contents) self._raw_contents = contents - self.content_map = content_map if content_map else {} - self.mtime_map: dict[str, float] = mtime_map if mtime_map else {} + self.content_map = content_map or {} + self.mtime_map: dict[str, float] = mtime_map or {} @property def sep(self) -> str: