mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Return window handles from WeakItemHandle
This commit is contained in:
parent
b2d9ccc0a2
commit
b77c336a3d
@ -281,7 +281,7 @@ pub trait ItemHandle: 'static + fmt::Debug {
|
||||
|
||||
pub trait WeakItemHandle {
|
||||
fn id(&self) -> usize;
|
||||
fn window_id(&self) -> usize;
|
||||
fn window(&self) -> AnyWindowHandle;
|
||||
fn upgrade(&self, cx: &AppContext) -> Option<Box<dyn ItemHandle>>;
|
||||
}
|
||||
|
||||
@ -650,8 +650,8 @@ impl<T: Item> WeakItemHandle for WeakViewHandle<T> {
|
||||
self.id()
|
||||
}
|
||||
|
||||
fn window_id(&self) -> usize {
|
||||
self.window_id()
|
||||
fn window(&self) -> AnyWindowHandle {
|
||||
self.window()
|
||||
}
|
||||
|
||||
fn upgrade(&self, cx: &AppContext) -> Option<Box<dyn ItemHandle>> {
|
||||
|
@ -259,7 +259,7 @@ impl<T: SearchableItem> WeakSearchableItemHandle for WeakViewHandle<T> {
|
||||
|
||||
impl PartialEq for Box<dyn WeakSearchableItemHandle> {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.id() == other.id() && self.window_id() == other.window_id()
|
||||
self.id() == other.id() && self.window() == other.window()
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,6 +267,6 @@ impl Eq for Box<dyn WeakSearchableItemHandle> {}
|
||||
|
||||
impl std::hash::Hash for Box<dyn WeakSearchableItemHandle> {
|
||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
(self.id(), self.window_id()).hash(state)
|
||||
(self.id(), self.window().id()).hash(state)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user