[red-knot] Simplify some traits in ast_ids.rs (#14379)

This commit is contained in:
Alex Waygood 2024-11-16 17:22:23 +00:00 committed by GitHub
parent a6a3d3f656
commit 81d3c419e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 50 additions and 68 deletions

View file

@ -6,7 +6,7 @@ use ruff_source_file::LineIndex;
use crate::module_name::ModuleName;
use crate::module_resolver::{resolve_module, Module};
use crate::semantic_index::ast_ids::HasScopedAstId;
use crate::semantic_index::ast_ids::HasScopedExpressionId;
use crate::semantic_index::semantic_index;
use crate::types::{binding_ty, infer_scope_types, Type};
use crate::Db;
@ -54,7 +54,7 @@ impl HasTy for ast::ExpressionRef<'_> {
let file_scope = index.expression_scope_id(*self);
let scope = file_scope.to_scope_id(model.db, model.file);
let expression_id = self.scoped_ast_id(model.db, scope);
let expression_id = self.scoped_expression_id(model.db, scope);
infer_scope_types(model.db, scope).expression_ty(expression_id)
}
}