]> git.lizzy.rs Git - rust.git/blobdiff - crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs
Use mutable syntax trees in `merge_imports`, `split_imports`
[rust.git] / crates / ide_assists / src / handlers / replace_qualified_name_with_use.rs
index 13367df807f33e6f732aec1640f4c81b1f3b1f32..6b196681cab0936d2e0491803fa111ad75e30df8 100644 (file)
@@ -70,7 +70,7 @@ pub(crate) fn replace_qualified_name_with_use(
         })
         .flatten();
 
-    let scope = ImportScope::find_insert_use_container_with_macros(path.syntax(), &ctx.sema)?;
+    let scope = ImportScope::find_insert_use_container(path.syntax(), &ctx.sema)?;
     let target = path.syntax().text_range();
     acc.add(
         AssistId("replace_qualified_name_with_use", AssistKind::RefactorRewrite),
@@ -141,10 +141,7 @@ fn path_eq_no_generics(lhs: ast::Path, rhs: ast::Path) -> bool {
                     && lhs
                         .name_ref()
                         .zip(rhs.name_ref())
-                        .map_or(false, |(lhs, rhs)| lhs.text() == rhs.text()) =>
-            {
-                ()
-            }
+                        .map_or(false, |(lhs, rhs)| lhs.text() == rhs.text()) => {}
             _ => return false,
         }
 
@@ -302,7 +299,7 @@ fn main() {
     ",
             r"
 mod std { pub mod fmt { pub trait Display {} } }
-use std::fmt::{self, Display};
+use std::fmt::{Display, self};
 
 fn main() {
     fmt;