File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -1488,7 +1488,7 @@ impl Impl {
1488
1488
pub fn all_for_type ( db : & dyn HirDatabase , Type { krate, ty } : Type ) -> Vec < Impl > {
1489
1489
let def_crates = match ty. value . def_crates ( db, krate) {
1490
1490
Some ( def_crates) => def_crates,
1491
- None => return vec ! [ ] ,
1491
+ None => return Vec :: new ( ) ,
1492
1492
} ;
1493
1493
1494
1494
let filter = |impl_def : & Impl | {
@@ -1498,16 +1498,11 @@ impl Impl {
1498
1498
} ;
1499
1499
1500
1500
let mut all = Vec :: new ( ) ;
1501
- def_crates. iter ( ) . for_each ( |& id| {
1501
+ def_crates. into_iter ( ) . for_each ( |id| {
1502
1502
all. extend ( db. inherent_impls_in_crate ( id) . all_impls ( ) . map ( Self :: from) . filter ( filter) )
1503
1503
} ) ;
1504
1504
let fp = TyFingerprint :: for_impl ( & ty. value ) ;
1505
- for id in def_crates
1506
- . iter ( )
1507
- . flat_map ( |& id| Crate { id } . reverse_dependencies ( db) )
1508
- . map ( |Crate { id } | id)
1509
- . chain ( def_crates. iter ( ) . copied ( ) )
1510
- {
1505
+ for id in db. crate_graph ( ) . iter ( ) {
1511
1506
match fp {
1512
1507
Some ( fp) => all. extend (
1513
1508
db. trait_impls_in_crate ( id) . for_self_ty ( fp) . map ( Self :: from) . filter ( filter) ,
You can’t perform that action at this time.
0 commit comments