Allow comparing ViewHandle to AnyViewHandle

Petros Amoiridis and Antonio Scandurra created

Since they both have a window_id and a view_id.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>

Change summary

crates/gpui/src/app.rs | 6 ++++++
1 file changed, 6 insertions(+)

Detailed changes

crates/gpui/src/app.rs 🔗

@@ -4915,6 +4915,12 @@ impl<T: View> From<ViewHandle<T>> for AnyViewHandle {
     }
 }
 
+impl<T> PartialEq<ViewHandle<T>> for AnyViewHandle {
+    fn eq(&self, other: &ViewHandle<T>) -> bool {
+        self.window_id == other.window_id && self.view_id == other.view_id
+    }
+}
+
 impl Drop for AnyViewHandle {
     fn drop(&mut self) {
         self.ref_counts