Refactor opening workspace items

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-01-07 17:38:37 +01:00
parent 3cab32d201
commit 794d214eee
15 changed files with 281 additions and 257 deletions

View file

@ -2773,6 +2773,10 @@ impl<T: Entity> WeakModelHandle<T> {
}
}
pub fn id(&self) -> usize {
self.model_id
}
pub fn upgrade(self, cx: &impl UpgradeModelHandle) -> Option<ModelHandle<T>> {
cx.upgrade_model_handle(self)
}