Use Scope#has in lieu of Scope#get (#5051)

## Summary

These usages don't actually need the `BindingId`.
This commit is contained in:
Charlie Marsh 2023-06-13 11:59:53 -04:00 committed by GitHub
parent b0f89fa814
commit 19f972a305
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}"),