diff options
Diffstat (limited to 'crates/vfs/src/lib.rs')
-rw-r--r-- | crates/vfs/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/vfs/src/lib.rs b/crates/vfs/src/lib.rs index 024e58018..cdf6f1fd0 100644 --- a/crates/vfs/src/lib.rs +++ b/crates/vfs/src/lib.rs | |||
@@ -70,7 +70,7 @@ impl ChangedFile { | |||
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | #[derive(Eq, PartialEq)] | 73 | #[derive(Eq, PartialEq, Copy, Clone, Debug)] |
74 | pub enum ChangeKind { | 74 | pub enum ChangeKind { |
75 | Create, | 75 | Create, |
76 | Modify, | 76 | Modify, |
@@ -90,12 +90,12 @@ impl Vfs { | |||
90 | pub fn file_contents(&self, file_id: FileId) -> &[u8] { | 90 | pub fn file_contents(&self, file_id: FileId) -> &[u8] { |
91 | self.get(file_id).as_deref().unwrap() | 91 | self.get(file_id).as_deref().unwrap() |
92 | } | 92 | } |
93 | pub fn iter(&self) -> impl Iterator<Item = (FileId, VfsPath)> + '_ { | 93 | pub fn iter(&self) -> impl Iterator<Item = (FileId, &VfsPath)> + '_ { |
94 | (0..self.data.len()) | 94 | (0..self.data.len()) |
95 | .map(|it| FileId(it as u32)) | 95 | .map(|it| FileId(it as u32)) |
96 | .filter(move |&file_id| self.get(file_id).is_some()) | 96 | .filter(move |&file_id| self.get(file_id).is_some()) |
97 | .map(move |file_id| { | 97 | .map(move |file_id| { |
98 | let path = self.interner.lookup(file_id).clone(); | 98 | let path = self.interner.lookup(file_id); |
99 | (file_id, path) | 99 | (file_id, path) |
100 | }) | 100 | }) |
101 | } | 101 | } |