3723: Fix typo of visibility_of r=edwin0cheng a=edwin0cheng

cc @kjeremy 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
This commit is contained in:
bors[bot] 2020-03-25 16:13:06 +00:00 committed by GitHub
commit 3d38d4dc94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -235,7 +235,7 @@ impl Module {
} }
pub fn visibility_of(self, db: &dyn HirDatabase, def: &ModuleDef) -> Option<Visibility> { pub fn visibility_of(self, db: &dyn HirDatabase, def: &ModuleDef) -> Option<Visibility> {
db.crate_def_map(self.id.krate)[self.id.local_id].scope.visbility_of(def.clone().into()) db.crate_def_map(self.id.krate)[self.id.local_id].scope.visibility_of(def.clone().into())
} }
pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) {

View file

@ -68,7 +68,7 @@ impl ItemScope {
self.impls.iter().copied() self.impls.iter().copied()
} }
pub fn visbility_of(&self, def: ModuleDefId) -> Option<Visibility> { pub fn visibility_of(&self, def: ModuleDefId) -> Option<Visibility> {
self.name_of(ItemInNs::Types(def)) self.name_of(ItemInNs::Types(def))
.or_else(|| self.name_of(ItemInNs::Values(def))) .or_else(|| self.name_of(ItemInNs::Values(def)))
.map(|(_, v)| v) .map(|(_, v)| v)