From 8f61134e7ea4e13bb099fa9205baef23135885e9 Mon Sep 17 00:00:00 2001 From: Petros Amoiridis Date: Thu, 2 Feb 2023 20:11:07 +0200 Subject: [PATCH] Allow comparing ViewHandle to AnyViewHandle Since they both have a window_id and a view_id. Co-Authored-By: Antonio Scandurra --- crates/gpui/src/app.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index 95967ed485..a72f7fc5c2 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -4915,6 +4915,12 @@ impl From> for AnyViewHandle { } } +impl PartialEq> for AnyViewHandle { + fn eq(&self, other: &ViewHandle) -> bool { + self.window_id == other.window_id && self.view_id == other.view_id + } +} + impl Drop for AnyViewHandle { fn drop(&mut self) { self.ref_counts