return single option

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
Hayashi Mikihiro 2025-03-28 15:46:41 +09:00
parent 2854ad9a41
commit a7dc60a2c4
3 changed files with 59 additions and 78 deletions

View file

@ -333,15 +333,14 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
}
pub(crate) fn resolve_path_in_type_ns(&mut self) -> Option<(TypeNs, Option<usize>)> {
let (resolution, remaining_index, prefix_info) = self
let (resolution, remaining_index, _, prefix_info) = self
.ctx
.resolver
.resolve_path_in_type_ns_with_prefix_info(self.ctx.db.upcast(), self.path)
.filter_map(|(res, remaining_index, _, prefix_info)| match res {
ModuleOrTypeNs::TypeNs(type_ns) => Some((type_ns, remaining_index, prefix_info)),
ModuleOrTypeNs::ModuleNs(_) => None,
})
.next()?;
.resolve_path_in_type_ns_with_prefix_info(self.ctx.db.upcast(), self.path)?;
let ModuleOrTypeNs::TypeNs(resolution) = resolution else {
return None;
};
let segments = self.segments;
if segments.is_empty() || matches!(self.path, Path::LangItem(..)) {