From fce6bc0acc375f38dd3c95f6c7a2c24360914046 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 Aug 2018 18:05:54 +0300 Subject: Make world private --- crates/libanalysis/src/lib.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs index ec20d106f..3f54a7f0d 100644 --- a/crates/libanalysis/src/lib.rs +++ b/crates/libanalysis/src/lib.rs @@ -56,7 +56,7 @@ pub struct WorldState { data: Arc } -pub struct World { +pub(crate) struct World { needs_reindex: AtomicBool, file_resolver: Arc, data: Arc, @@ -88,22 +88,16 @@ impl WorldState { } } - pub fn snapshot( + pub fn analysis( &self, file_resolver: impl FileResolver, - ) -> World { - World { + ) -> Analysis { + let imp = World { needs_reindex: AtomicBool::new(false), file_resolver: Arc::new(file_resolver), data: self.data.clone() - } - } - - pub fn analysis( - &self, - file_resolver: impl FileResolver, - ) -> Analysis { - Analysis { imp: self.snapshot(file_resolver) } + }; + Analysis { imp } } pub fn change_file(&mut self, file_id: FileId, text: Option) { -- cgit v1.2.3