mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 21:04:18 +00:00
return single option
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
parent
2854ad9a41
commit
a7dc60a2c4
3 changed files with 59 additions and 78 deletions
|
|
@ -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(..)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue