Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs')
-rw-r--r--crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs b/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs
index 45bb6ce912..2bf4406cc6 100644
--- a/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs
+++ b/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs
@@ -71,6 +71,7 @@ pub(crate) fn replace_derive_with_manual_impl(
let current_module = ctx.sema.scope(adt.syntax())?.module();
let current_crate = current_module.krate();
let current_edition = current_crate.edition(ctx.db());
+ let cfg = ctx.config.find_path_config(ctx.sema.is_nightly(current_crate));
let found_traits = items_locator::items_with_name(
ctx.db(),
@@ -84,7 +85,7 @@ pub(crate) fn replace_derive_with_manual_impl(
})
.flat_map(|trait_| {
current_module
- .find_path(ctx.sema.db, hir::ModuleDef::Trait(trait_), ctx.config.import_path_config())
+ .find_path(ctx.sema.db, hir::ModuleDef::Trait(trait_), cfg)
.as_ref()
.map(|path| mod_path_to_ast(path, current_edition))
.zip(Some(trait_))
@@ -221,11 +222,7 @@ fn impl_def_from_trait(
} else {
Some(first.clone())
};
- let items = first_item
- .into_iter()
- .chain(other.iter().cloned())
- .map(either::Either::Right)
- .collect();
+ let items = first_item.into_iter().chain(other.iter().cloned()).collect();
make::assoc_item_list(Some(items))
} else {
make::assoc_item_list(None)