@@ -17,7 +17,7 @@ use prometheus_static_metric::make_static_metric;
17
17
use ratatui:: { layout:: Constraint , widgets:: Row } ;
18
18
use tokio:: io:: { AsyncRead , AsyncWrite } ;
19
19
20
- use crate :: widget:: { table:: RowStyle , TableRow } ;
20
+ use crate :: widget:: table;
21
21
22
22
make_static_metric ! {
23
23
pub struct ResourceVec : IntCounter {
@@ -141,7 +141,19 @@ impl PartialEq for Tunnel {
141
141
142
142
impl Eq for Tunnel { }
143
143
144
- impl < ' a > TableRow < ' a > for Tunnel {
144
+ impl PartialOrd for Tunnel {
145
+ fn partial_cmp ( & self , other : & Self ) -> Option < std:: cmp:: Ordering > {
146
+ Some ( self . cmp ( other) )
147
+ }
148
+ }
149
+
150
+ impl Ord for Tunnel {
151
+ fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
152
+ self . addr ( ) . cmp ( & other. addr ( ) )
153
+ }
154
+ }
155
+
156
+ impl table:: Row for Tunnel {
145
157
fn constraints ( ) -> Vec < Constraint > {
146
158
vec ! [
147
159
Constraint :: Length ( 10 ) ,
@@ -150,7 +162,7 @@ impl<'a> TableRow<'a> for Tunnel {
150
162
]
151
163
}
152
164
153
- fn row ( & self , style : & RowStyle ) -> Row {
165
+ fn row ( & self , style : & table :: RowStyle ) -> Row {
154
166
Row :: new ( vec ! [
155
167
self . kind. to_string( ) . to_lowercase( ) ,
156
168
format!( "{}:{}" , self . host, self . port) ,
0 commit comments