From fce6bc0acc375f38dd3c95f6c7a2c24360914046 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 Aug 2018 18:05:54 +0300 Subject: [PATCH] Make world private --- crates/libanalysis/src/lib.rs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs index ec20d106f6..3f54a7f0d0 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( - &self, - file_resolver: impl FileResolver, - ) -> World { - 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) } + let imp = World { + needs_reindex: AtomicBool::new(false), + file_resolver: Arc::new(file_resolver), + data: self.data.clone() + }; + Analysis { imp } } pub fn change_file(&mut self, file_id: FileId, text: Option) {