mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
make PerNs non-generic
This commit is contained in:
parent
51e2d76b98
commit
2fbe79ed9a
4 changed files with 30 additions and 34 deletions
|
@ -112,11 +112,7 @@ impl Resolver {
|
|||
}
|
||||
|
||||
/// pub only for source-binder
|
||||
pub(crate) fn resolve_module_path(
|
||||
&self,
|
||||
db: &impl HirDatabase,
|
||||
path: &Path,
|
||||
) -> PerNs<ModuleDef> {
|
||||
pub(crate) fn resolve_module_path(&self, db: &impl HirDatabase, path: &Path) -> PerNs {
|
||||
let (item_map, module) = match self.module() {
|
||||
Some(it) => it,
|
||||
None => return PerNs::none(),
|
||||
|
@ -385,8 +381,8 @@ pub enum ScopeDef {
|
|||
Unknown,
|
||||
}
|
||||
|
||||
impl From<PerNs<ModuleDef>> for ScopeDef {
|
||||
fn from(def: PerNs<ModuleDef>) -> Self {
|
||||
impl From<PerNs> for ScopeDef {
|
||||
fn from(def: PerNs) -> Self {
|
||||
def.take_types()
|
||||
.or_else(|| def.take_values())
|
||||
.map(ScopeDef::ModuleDef)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue