@@ -50,7 +50,7 @@ pub trait FileLoader {
5050 /// Text of the file.
5151 fn file_text ( & self , file_id : FileId ) -> Arc < str > ;
5252 fn resolve_path ( & self , path : AnchoredPath < ' _ > ) -> Option < FileId > ;
53- fn relevant_crates ( & self , file_id : FileId ) -> Arc < FxHashSet < CrateId > > ;
53+ fn relevant_crates ( & self , file_id : FileId ) -> Arc < [ CrateId ] > ;
5454}
5555
5656/// Database which stores all significant input facts: source code and project
@@ -85,19 +85,20 @@ pub trait SourceDatabaseExt: SourceDatabase {
8585 #[ salsa:: input]
8686 fn source_root ( & self , id : SourceRootId ) -> Arc < SourceRoot > ;
8787
88- fn source_root_crates ( & self , id : SourceRootId ) -> Arc < FxHashSet < CrateId > > ;
88+ fn source_root_crates ( & self , id : SourceRootId ) -> Arc < [ CrateId ] > ;
8989}
9090
91- fn source_root_crates ( db : & dyn SourceDatabaseExt , id : SourceRootId ) -> Arc < FxHashSet < CrateId > > {
91+ fn source_root_crates ( db : & dyn SourceDatabaseExt , id : SourceRootId ) -> Arc < [ CrateId ] > {
9292 let graph = db. crate_graph ( ) ;
93- let res = graph
93+ graph
9494 . iter ( )
9595 . filter ( |& krate| {
9696 let root_file = graph[ krate] . root_file_id ;
9797 db. file_source_root ( root_file) == id
9898 } )
99- . collect ( ) ;
100- Arc :: new ( res)
99+ . collect :: < FxHashSet < _ > > ( )
100+ . into_iter ( )
101+ . collect ( )
101102}
102103
103104/// Silly workaround for cyclic deps between the traits
@@ -114,7 +115,7 @@ impl<T: SourceDatabaseExt> FileLoader for FileLoaderDelegate<&'_ T> {
114115 source_root. resolve_path ( path)
115116 }
116117
117- fn relevant_crates ( & self , file_id : FileId ) -> Arc < FxHashSet < CrateId > > {
118+ fn relevant_crates ( & self , file_id : FileId ) -> Arc < [ CrateId ] > {
118119 let _p = profile:: span ( "relevant_crates" ) ;
119120 let source_root = self . 0 . file_source_root ( file_id) ;
120121 self . 0 . source_root_crates ( source_root)
0 commit comments