Minor code simplification (#19022)

When inside a typing only annotation, the code is always inside an
annotation, too.
This commit is contained in:
Robsdedude 2025-06-30 08:12:59 +00:00 committed by GitHub
parent bedb53daec
commit 4103d73224
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2765,9 +2765,7 @@ impl<'a> Checker<'a> {
self.semantic.restore(snapshot);
if self.semantic.in_annotation()
&& self.semantic.in_typing_only_annotation()
{
if self.semantic.in_typing_only_annotation() {
if self.is_rule_enabled(Rule::QuotedAnnotation) {
pyupgrade::rules::quoted_annotation(self, annotation, range);
}