From 062aa9723583cd6dae17b3bbe604ec7ad6c0394b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 18 Feb 2019 14:21:25 +0300 Subject: [PATCH] move public API to top of the file --- Cargo.lock | 1 - crates/ra_vfs/src/lib.rs | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39bfcde416e..25ad749eed7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1128,7 +1128,6 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "notify 4.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ra_arena 0.1.0", "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/crates/ra_vfs/src/lib.rs b/crates/ra_vfs/src/lib.rs index d07bc569448..8005c4ff8ae 100644 --- a/crates/ra_vfs/src/lib.rs +++ b/crates/ra_vfs/src/lib.rs @@ -66,6 +66,14 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { } } +#[derive(Debug, Clone)] +pub enum VfsChange { + AddRoot { root: VfsRoot, files: Vec<(VfsFile, RelativePathBuf, Arc)> }, + AddFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf, text: Arc }, + RemoveFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf }, + ChangeFile { file: VfsFile, text: Arc }, +} + impl Vfs { pub fn new(roots: Vec) -> (Vfs, Vec) { let roots = Arc::new(Roots::new(roots)); @@ -276,11 +284,3 @@ fn file_mut(&mut self, file: VfsFile) -> &mut VfsFileData { &mut self.files[file.0 as usize] } } - -#[derive(Debug, Clone)] -pub enum VfsChange { - AddRoot { root: VfsRoot, files: Vec<(VfsFile, RelativePathBuf, Arc)> }, - AddFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf, text: Arc }, - RemoveFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf }, - ChangeFile { file: VfsFile, text: Arc }, -} -- 2.44.0