diff options
author | Aleksey Kladov <[email protected]> | 2019-02-18 11:21:25 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-02-18 11:29:39 +0000 |
commit | 062aa9723583cd6dae17b3bbe604ec7ad6c0394b (patch) | |
tree | 059b9b1db3eb6c859fdc2fcc229d75a671b9f6c8 | |
parent | 74288ae272029262beffb7696752a222e36fe49e (diff) |
move public API to top of the file
-rw-r--r-- | Cargo.lock | 1 | ||||
-rw-r--r-- | crates/ra_vfs/src/lib.rs | 16 |
2 files changed, 8 insertions, 9 deletions
diff --git a/Cargo.lock b/Cargo.lock index 39bfcde41..25ad749ee 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -1128,7 +1128,6 @@ dependencies = [ | |||
1128 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", | 1128 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", |
1129 | "notify 4.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | 1129 | "notify 4.0.9 (registry+https://github.com/rust-lang/crates.io-index)", |
1130 | "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1130 | "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1131 | "ra_arena 0.1.0", | ||
1132 | "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1131 | "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1133 | "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1132 | "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1134 | "tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1133 | "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 d07bc5694..8005c4ff8 100644 --- a/crates/ra_vfs/src/lib.rs +++ b/crates/ra_vfs/src/lib.rs | |||
@@ -66,6 +66,14 @@ impl fmt::Debug for Vfs { | |||
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | #[derive(Debug, Clone)] | ||
70 | pub enum VfsChange { | ||
71 | AddRoot { root: VfsRoot, files: Vec<(VfsFile, RelativePathBuf, Arc<String>)> }, | ||
72 | AddFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf, text: Arc<String> }, | ||
73 | RemoveFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf }, | ||
74 | ChangeFile { file: VfsFile, text: Arc<String> }, | ||
75 | } | ||
76 | |||
69 | impl Vfs { | 77 | impl Vfs { |
70 | pub fn new(roots: Vec<PathBuf>) -> (Vfs, Vec<VfsRoot>) { | 78 | pub fn new(roots: Vec<PathBuf>) -> (Vfs, Vec<VfsRoot>) { |
71 | let roots = Arc::new(Roots::new(roots)); | 79 | let roots = Arc::new(Roots::new(roots)); |
@@ -276,11 +284,3 @@ impl Vfs { | |||
276 | &mut self.files[file.0 as usize] | 284 | &mut self.files[file.0 as usize] |
277 | } | 285 | } |
278 | } | 286 | } |
279 | |||
280 | #[derive(Debug, Clone)] | ||
281 | pub enum VfsChange { | ||
282 | AddRoot { root: VfsRoot, files: Vec<(VfsFile, RelativePathBuf, Arc<String>)> }, | ||
283 | AddFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf, text: Arc<String> }, | ||
284 | RemoveFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf }, | ||
285 | ChangeFile { file: VfsFile, text: Arc<String> }, | ||
286 | } | ||