@@ -790,7 +790,7 @@ enum ParentLink<'a> {
790
790
/// One node in the tree of modules.
791
791
pub struct ModuleS < ' a > {
792
792
parent_link : ParentLink < ' a > ,
793
- def : Cell < Option < Def > > ,
793
+ def : Option < Def > ,
794
794
is_public : bool ,
795
795
is_extern_crate : bool ,
796
796
@@ -840,7 +840,7 @@ impl<'a> ModuleS<'a> {
840
840
fn new ( parent_link : ParentLink < ' a > , def : Option < Def > , external : bool , is_public : bool ) -> Self {
841
841
ModuleS {
842
842
parent_link : parent_link,
843
- def : Cell :: new ( def) ,
843
+ def : def,
844
844
is_public : is_public,
845
845
is_extern_crate : false ,
846
846
children : RefCell :: new ( HashMap :: new ( ) ) ,
@@ -878,18 +878,18 @@ impl<'a> ModuleS<'a> {
878
878
}
879
879
880
880
fn def_id ( & self ) -> Option < DefId > {
881
- self . def . get ( ) . as_ref ( ) . map ( Def :: def_id)
881
+ self . def . as_ref ( ) . map ( Def :: def_id)
882
882
}
883
883
884
884
fn is_normal ( & self ) -> bool {
885
- match self . def . get ( ) {
885
+ match self . def {
886
886
Some ( Def :: Mod ( _) ) | Some ( Def :: ForeignMod ( _) ) => true ,
887
887
_ => false ,
888
888
}
889
889
}
890
890
891
891
fn is_trait ( & self ) -> bool {
892
- match self . def . get ( ) {
892
+ match self . def {
893
893
Some ( Def :: Trait ( _) ) => true ,
894
894
_ => false ,
895
895
}
@@ -988,7 +988,7 @@ impl<'a> NameBinding<'a> {
988
988
fn def ( & self ) -> Option < Def > {
989
989
match self . def_or_module {
990
990
DefOrModule :: Def ( def) => Some ( def) ,
991
- DefOrModule :: Module ( ref module) => module. def . get ( ) ,
991
+ DefOrModule :: Module ( ref module) => module. def ,
992
992
}
993
993
}
994
994
0 commit comments