Add prefix file_ to Semantics's to_module_defs()/to_module_def() methods

This commit is contained in:
Vincent Esche 2024-02-28 10:13:31 +01:00
parent 0ac05c0527
commit 6112ddfabb
12 changed files with 16 additions and 16 deletions

View file

@ -223,12 +223,12 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> {
self.imp.resolve_variant(record_lit).map(VariantDef::from)
}
pub fn to_module_def(&self, file: FileId) -> Option<Module> {
self.imp.to_module_def(file).next()
pub fn file_to_module_def(&self, file: FileId) -> Option<Module> {
self.imp.file_to_module_defs(file).next()
}
pub fn to_module_defs(&self, file: FileId) -> impl Iterator<Item = Module> {
self.imp.to_module_def(file)
pub fn file_to_module_defs(&self, file: FileId) -> impl Iterator<Item = Module> {
self.imp.file_to_module_defs(file)
}
pub fn to_struct_def(&self, s: &ast::Struct) -> Option<Struct> {
@ -1237,7 +1237,7 @@ impl<'db> SemanticsImpl<'db> {
T::to_def(self, src)
}
fn to_module_def(&self, file: FileId) -> impl Iterator<Item = Module> {
fn file_to_module_defs(&self, file: FileId) -> impl Iterator<Item = Module> {
self.with_ctx(|ctx| ctx.file_to_def(file)).into_iter().map(Module::from)
}