Skip to content

Commit 959bd84

Browse files
committed
nits
1 parent a421642 commit 959bd84

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

crates/ty_python_core/src/builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,9 +3334,10 @@ impl<'ast> Visitor<'ast> for SemanticIndexBuilder<'_, 'ast> {
33343334
}
33353335
}
33363336
ast::Expr::Lambda(lambda) => {
3337-
if let Some(current_statement) = self.current_statement_mut() {
3338-
current_statement.lambda_exprs.push(lambda);
3339-
}
3337+
self.current_statement_mut()
3338+
.expect("every lambda expression is part of a statement")
3339+
.lambda_exprs
3340+
.push(lambda);
33403341

33413342
if let Some(parameters) = &lambda.parameters {
33423343
// The default value of the parameters needs to be evaluated in the

crates/ty_python_semantic/src/types/infer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ use ruff_text_size::Ranged;
4848
use rustc_hash::{FxHashMap, FxHashSet};
4949
use salsa;
5050
use salsa::plumbing::AsId;
51-
use ty_python_core::statement::StatementInner;
5251

5352
use crate::Db;
5453
use crate::types::diagnostic::TypeCheckDiagnostics;
@@ -64,6 +63,7 @@ pub(super) use comparisons::UnsupportedComparisonError;
6463
use ty_python_core::definition::Definition;
6564
use ty_python_core::expression::Expression;
6665
use ty_python_core::scope::ScopeId;
66+
use ty_python_core::statement::StatementInner;
6767
use ty_python_core::unpack::Unpack;
6868
use ty_python_core::{ExpressionNodeKey, SemanticIndex, Statement, semantic_index};
6969

0 commit comments

Comments
 (0)