Skip to content

Commit bf13549

Browse files
committed
rename fn name take_path to any
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
1 parent 30fe761 commit bf13549

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

crates/hir/src/semantics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl PathResolutionPerNs {
118118
) -> Self {
119119
PathResolutionPerNs { type_ns, value_ns, macro_ns }
120120
}
121-
pub fn take_path(&self) -> Option<PathResolution> {
121+
pub fn any(&self) -> Option<PathResolution> {
122122
self.type_ns.or(self.value_ns).or(self.macro_ns)
123123
}
124124
}

crates/hir/src/source_analyzer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ impl<'db> SourceAnalyzer<'db> {
11631163
Some(&store),
11641164
false,
11651165
)
1166-
.take_path()?;
1166+
.any()?;
11671167
let subst = (|| {
11681168
let parent = parent()?;
11691169
let ty = if let Some(expr) = ast::Expr::cast(parent.clone()) {
@@ -1556,7 +1556,7 @@ pub(crate) fn resolve_hir_path(
15561556
hygiene: HygieneId,
15571557
store: Option<&ExpressionStore>,
15581558
) -> Option<PathResolution> {
1559-
resolve_hir_path_(db, resolver, path, false, hygiene, store, false).take_path()
1559+
resolve_hir_path_(db, resolver, path, false, hygiene, store, false).any()
15601560
}
15611561

15621562
#[inline]
@@ -1677,7 +1677,7 @@ fn resolve_hir_path_(
16771677
.unwrap_or_else(|| PathResolutionPerNs::new(None, values(), None))
16781678
};
16791679

1680-
if res.take_path().is_some() {
1680+
if res.any().is_some() {
16811681
res
16821682
} else if let Some(type_ns) = items() {
16831683
PathResolutionPerNs::new(Some(type_ns), None, None)

crates/ide-assists/src/handlers/remove_unused_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub(crate) fn remove_unused_imports(acc: &mut Assists, ctx: &AssistContext<'_>)
8181

8282
// Get the actual definition associated with this use item.
8383
let res = match ctx.sema.resolve_path_per_ns(&path) {
84-
Some(x) if x.take_path().is_some() => x,
84+
Some(x) if x.any().is_some() => x,
8585
Some(_) | None => {
8686
return None;
8787
}

0 commit comments

Comments
 (0)