diff options
author | Aleksey Kladov <[email protected]> | 2018-10-15 20:29:24 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-15 20:29:24 +0100 |
commit | bbcd998433075aba66ef0677bcdd821ca5fc926e (patch) | |
tree | 58130242a9a726bb552d01f5c72d1c4d13ead701 /crates/ra_analysis/src/imp.rs | |
parent | 76c51fae77d5dc2d7791132ecc78e444118e48de (diff) |
make analysis sync
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 0cf6db40d..d07d797d5 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -78,13 +78,13 @@ impl Default for FileResolverImp { | |||
78 | 78 | ||
79 | #[derive(Debug)] | 79 | #[derive(Debug)] |
80 | pub(crate) struct AnalysisHostImpl { | 80 | pub(crate) struct AnalysisHostImpl { |
81 | data: Arc<WorldData> | 81 | data: WorldData |
82 | } | 82 | } |
83 | 83 | ||
84 | impl AnalysisHostImpl { | 84 | impl AnalysisHostImpl { |
85 | pub fn new() -> AnalysisHostImpl { | 85 | pub fn new() -> AnalysisHostImpl { |
86 | AnalysisHostImpl { | 86 | AnalysisHostImpl { |
87 | data: Arc::new(WorldData::default()), | 87 | data: WorldData::default(), |
88 | } | 88 | } |
89 | } | 89 | } |
90 | pub fn analysis(&self) -> AnalysisImpl { | 90 | pub fn analysis(&self) -> AnalysisImpl { |
@@ -114,18 +114,18 @@ impl AnalysisHostImpl { | |||
114 | self.data_mut().libs.push(Arc::new(root)); | 114 | self.data_mut().libs.push(Arc::new(root)); |
115 | } | 115 | } |
116 | fn data_mut(&mut self) -> &mut WorldData { | 116 | fn data_mut(&mut self) -> &mut WorldData { |
117 | Arc::make_mut(&mut self.data) | 117 | &mut self.data |
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | pub(crate) struct AnalysisImpl { | 121 | pub(crate) struct AnalysisImpl { |
122 | needs_reindex: AtomicBool, | 122 | needs_reindex: AtomicBool, |
123 | data: Arc<WorldData>, | 123 | data: WorldData, |
124 | } | 124 | } |
125 | 125 | ||
126 | impl fmt::Debug for AnalysisImpl { | 126 | impl fmt::Debug for AnalysisImpl { |
127 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | 127 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
128 | (&*self.data).fmt(f) | 128 | self.data.fmt(f) |
129 | } | 129 | } |
130 | } | 130 | } |
131 | 131 | ||
@@ -133,7 +133,7 @@ impl Clone for AnalysisImpl { | |||
133 | fn clone(&self) -> AnalysisImpl { | 133 | fn clone(&self) -> AnalysisImpl { |
134 | AnalysisImpl { | 134 | AnalysisImpl { |
135 | needs_reindex: AtomicBool::new(self.needs_reindex.load(SeqCst)), | 135 | needs_reindex: AtomicBool::new(self.needs_reindex.load(SeqCst)), |
136 | data: Arc::clone(&self.data), | 136 | data: self.data.clone(), |
137 | } | 137 | } |
138 | } | 138 | } |
139 | } | 139 | } |