@@ -10,7 +10,7 @@ use crate::position::Position;
10
10
11
11
/// Contains the position and size of a [`Pane`], or more generally of any terminal, measured
12
12
/// in character rows and columns.
13
- #[ derive( Clone , Copy , Default , Debug , Serialize , Deserialize , Hash ) ]
13
+ #[ derive( Clone , Copy , Default , Debug , Serialize , Deserialize ) ]
14
14
pub struct PaneGeom {
15
15
pub x : usize ,
16
16
pub y : usize ,
@@ -24,6 +24,7 @@ pub struct PaneGeom {
24
24
impl PartialEq for PaneGeom {
25
25
fn eq ( & self , other : & Self ) -> bool {
26
26
// compare all except is_pinned
27
+ // NOTE: Keep this in sync with what the `Hash` trait impl does.
27
28
self . x == other. x
28
29
&& self . y == other. y
29
30
&& self . rows == other. rows
@@ -32,6 +33,17 @@ impl PartialEq for PaneGeom {
32
33
}
33
34
}
34
35
36
+ impl std:: hash:: Hash for PaneGeom {
37
+ fn hash < H : Hasher > ( & self , state : & mut H ) {
38
+ // NOTE: Keep this in sync with what the `PartiqlEq` trait impl does.
39
+ self . x . hash ( state) ;
40
+ self . y . hash ( state) ;
41
+ self . rows . hash ( state) ;
42
+ self . cols . hash ( state) ;
43
+ self . is_stacked . hash ( state) ;
44
+ }
45
+ }
46
+
35
47
impl Eq for PaneGeom { }
36
48
37
49
#[ derive( Clone , Copy , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
0 commit comments