mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Use Scope#has
in lieu of Scope#get
(#5051)
## Summary These usages don't actually need the `BindingId`.
This commit is contained in:
parent
b0f89fa814
commit
19f972a305
1 changed files with 3 additions and 3 deletions
|
@ -405,7 +405,7 @@ impl<'a> SemanticModel<'a> {
|
|||
if self
|
||||
.scopes()
|
||||
.take(scope_index)
|
||||
.all(|scope| scope.get(name).is_none())
|
||||
.all(|scope| !scope.has(name))
|
||||
{
|
||||
return Some(ImportedName {
|
||||
name: format!("{name}.{member}"),
|
||||
|
@ -428,7 +428,7 @@ impl<'a> SemanticModel<'a> {
|
|||
if self
|
||||
.scopes()
|
||||
.take(scope_index)
|
||||
.all(|scope| scope.get(name).is_none())
|
||||
.all(|scope| !scope.has(name))
|
||||
{
|
||||
return Some(ImportedName {
|
||||
name: (*name).to_string(),
|
||||
|
@ -449,7 +449,7 @@ impl<'a> SemanticModel<'a> {
|
|||
if self
|
||||
.scopes()
|
||||
.take(scope_index)
|
||||
.all(|scope| scope.get(name).is_none())
|
||||
.all(|scope| !scope.has(name))
|
||||
{
|
||||
return Some(ImportedName {
|
||||
name: format!("{name}.{member}"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue