Introduce a File trait object to buffer

This will remove the dependency of buffer on `worktree::File`
This commit is contained in:
Nathan Sobo
2021-10-02 19:01:29 -06:00
parent 7728467790
commit f00045544f
5 changed files with 216 additions and 138 deletions
+2 -2
View File
@@ -1383,7 +1383,7 @@ mod tests {
.update(&mut cx_b, |worktree, cx| worktree.open_buffer("a.txt", cx))
.await
.unwrap();
let mtime = buffer_b.read_with(&cx_b, |buf, _| buf.file().unwrap().mtime);
let mtime = buffer_b.read_with(&cx_b, |buf, _| buf.file().unwrap().mtime());
buffer_b.update(&mut cx_b, |buf, cx| buf.edit([0..0], "world ", cx));
buffer_b.read_with(&cx_b, |buf, _| {
@@ -1398,7 +1398,7 @@ mod tests {
.unwrap();
worktree_b
.condition(&cx_b, |_, cx| {
buffer_b.read(cx).file().unwrap().mtime != mtime
buffer_b.read(cx).file().unwrap().mtime() != mtime
})
.await;
buffer_b.read_with(&cx_b, |buf, _| {