Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/missing_fields.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/missing_fields.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/crates/ide-diagnostics/src/handlers/missing_fields.rs b/crates/ide-diagnostics/src/handlers/missing_fields.rs
index 7da799e0d4..49f925e2e0 100644
--- a/crates/ide-diagnostics/src/handlers/missing_fields.rs
+++ b/crates/ide-diagnostics/src/handlers/missing_fields.rs
@@ -1,6 +1,6 @@
use either::Either;
use hir::{
- AssocItem, HirDisplay, ImportPathConfig, InFile, Type,
+ AssocItem, FindPathConfig, HirDisplay, InFile, Type,
db::{ExpandDatabase, HirDatabase},
sym,
};
@@ -132,7 +132,7 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::MissingFields) -> Option<Vec<Ass
let type_path = current_module?.find_path(
ctx.sema.db,
item_for_path_search(ctx.sema.db, item_in_ns)?,
- ImportPathConfig {
+ FindPathConfig {
prefer_no_std: ctx.config.prefer_no_std,
prefer_prelude: ctx.config.prefer_prelude,
prefer_absolute: ctx.config.prefer_absolute,
@@ -227,12 +227,11 @@ fn get_default_constructor(
// Look for a ::new() associated function
let has_new_func = ty
.iterate_assoc_items(ctx.sema.db, krate, |assoc_item| {
- if let AssocItem::Function(func) = assoc_item {
- if func.name(ctx.sema.db) == sym::new
- && func.assoc_fn_params(ctx.sema.db).is_empty()
- {
- return Some(());
- }
+ if let AssocItem::Function(func) = assoc_item
+ && func.name(ctx.sema.db) == sym::new
+ && func.assoc_fn_params(ctx.sema.db).is_empty()
+ {
+ return Some(());
}
None