File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -202,12 +202,7 @@ pub struct ModuleData {
202
202
203
203
impl Default for ModuleData {
204
204
fn default ( ) -> Self {
205
- ModuleData {
206
- parent : None ,
207
- children : FxHashMap :: default ( ) ,
208
- scope : ItemScope :: default ( ) ,
209
- origin : ModuleOrigin :: CrateRoot { definition : FileId ( !0 ) } ,
210
- }
205
+ ModuleData :: new ( ModuleOrigin :: CrateRoot { definition : FileId ( !0 ) } )
211
206
}
212
207
}
213
208
@@ -450,6 +445,15 @@ impl DefMap {
450
445
}
451
446
452
447
impl ModuleData {
448
+ pub ( crate ) fn new ( origin : ModuleOrigin ) -> Self {
449
+ ModuleData {
450
+ parent : None ,
451
+ children : FxHashMap :: default ( ) ,
452
+ scope : ItemScope :: default ( ) ,
453
+ origin,
454
+ }
455
+ }
456
+
453
457
/// Returns a node which defines this module. That is, a file or a `mod foo {}` with items.
454
458
pub fn definition_source ( & self , db : & dyn DefDatabase ) -> InFile < ModuleSource > {
455
459
self . origin . definition_source ( db)
You can’t perform that action at this time.
0 commit comments