Remove weak handles when worktree gets dropped

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2022-01-21 14:34:14 +01:00
co-authored by Nathan Sobo
parent e5662dd426
commit 2fcf1aee6b
2 changed files with 20 additions and 10 deletions
+4
View File
@@ -267,6 +267,10 @@ impl Worktree {
}
}
pub fn is_local(&self) -> bool {
matches!(self, Worktree::Local(_))
}
pub fn snapshot(&self) -> Snapshot {
match self {
Worktree::Local(worktree) => worktree.snapshot(),