mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:42:10 +00:00
Make collect_call_path
return an Option
(#3849)
This commit is contained in:
parent
d822e08111
commit
08e5b3fa61
21 changed files with 158 additions and 138 deletions
|
@ -4,6 +4,7 @@ use rustpython_parser::ast::{Expr, ExprKind, Location};
|
|||
|
||||
use ruff_python_stdlib::typing::{PEP_585_BUILTINS_ELIGIBLE, PEP_593_SUBSCRIPTS, SUBSCRIPTS};
|
||||
|
||||
use crate::call_path::{from_unqualified_name, CallPath};
|
||||
use crate::context::Context;
|
||||
use crate::relocate::relocate_expr;
|
||||
use crate::source_code::Locator;
|
||||
|
@ -47,7 +48,7 @@ pub fn match_annotated_subscript<'a>(
|
|||
}
|
||||
|
||||
for module in typing_modules {
|
||||
let module_call_path = module.split('.').collect::<Vec<_>>();
|
||||
let module_call_path: CallPath = from_unqualified_name(module);
|
||||
if call_path.starts_with(&module_call_path) {
|
||||
for subscript in SUBSCRIPTS.iter() {
|
||||
if call_path.last() == subscript.last() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue