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:33:36 +01:00
parent e5662dd426
commit 2fcf1aee6b
2 changed files with 20 additions and 10 deletions

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(),