internal: Refine CrateOrigin variants

This commit is contained in:
Lukas Wirth 2023-03-31 09:10:18 +02:00
parent 42d671fcb7
commit 31db1fc75f
12 changed files with 343 additions and 235 deletions

View file

@ -160,7 +160,7 @@ impl Vfs {
/// [`FileId`] for it.
pub fn set_file_contents(&mut self, path: VfsPath, contents: Option<Vec<u8>>) -> bool {
let file_id = self.alloc_file_id(path);
let change_kind = match (&self.get(file_id), &contents) {
let change_kind = match (self.get(file_id), &contents) {
(None, None) => return false,
(Some(old), Some(new)) if old == new => return false,
(None, Some(_)) => ChangeKind::Create,