mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-18 17:40:37 +00:00
[ty] remove unnecessary Either (#18489)
Just a quick review-comment follow-up.
This commit is contained in:
parent
5faf72a4d9
commit
cb8246bc5f
1 changed files with 2 additions and 2 deletions
|
@ -9021,9 +9021,9 @@ impl<'db> TypeInferenceBuilder<'db, '_> {
|
|||
) -> Type<'db> {
|
||||
let arguments = &*subscript_node.slice;
|
||||
let (args, args_number) = if let ast::Expr::Tuple(t) = arguments {
|
||||
(Either::Left(t), t.len())
|
||||
(t.iter(), t.len())
|
||||
} else {
|
||||
(Either::Right([arguments]), 1)
|
||||
(std::slice::from_ref(arguments).iter(), 1)
|
||||
};
|
||||
if args_number != expected_arg_count {
|
||||
if let Some(builder) = self.context.report_lint(&INVALID_TYPE_FORM, subscript_node) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue