File tree Expand file tree Collapse file tree 4 files changed +6
-12
lines changed
Expand file tree Collapse file tree 4 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -877,10 +877,7 @@ impl App {
877877 self . session_view
878878 . scroll_to_line ( entry. source ( self . session_view . stack_depth ( ) ) . line_no )
879879 }
880- match self . channels . channel_by_offset ( self . session_view . eval_state . channel ) {
881- Some ( c) => self . focus_channel ( c. name . clone ( ) ) ,
882- None => ( ) ,
883- }
880+ if let Some ( c) = self . channels . channel_by_offset ( self . session_view . eval_state . channel ) { self . focus_channel ( c. name . clone ( ) ) }
884881 }
885882
886883 fn focus_channel ( & mut self , channel : String ) {
Original file line number Diff line number Diff line change 11use std:: { collections:: { hash_map:: Entry , HashMap } , sync:: Arc } ;
2- use log:: info;
32use tokio:: sync:: Mutex ;
43
54pub struct Channels {
@@ -126,7 +125,7 @@ impl Channel {
126125
127126 pub ( crate ) async fn writeln ( & self , join : String ) {
128127 self . write ( join) . await ;
129- self . buffer . lock ( ) . await . push_str ( " \n " ) ;
128+ self . buffer . lock ( ) . await . push ( '\n' ) ;
130129 }
131130
132131 pub ( crate ) fn viewport ( & self , height : u16 , scroll : u16 ) -> & [ String ] {
@@ -159,7 +158,7 @@ mod test {
159158 assert_eq ! ( 0 , channel. lines. len( ) ) ;
160159 channel. unload ( 100 ) . await ;
161160
162- assert_eq ! ( 7 , channel. lines. len( ) ) ;
161+ assert_eq ! ( 6 , channel. lines. len( ) ) ;
163162 }
164163
165164 #[ tokio:: test]
@@ -173,7 +172,7 @@ mod test {
173172 assert_eq ! ( 1 , channel. lines. len( ) ) ;
174173 channel. write ( "barfoo\n " . to_string ( ) ) . await ;
175174 channel. unload ( 100 ) . await ;
176- assert_eq ! ( 2 , channel. lines. len( ) ) ;
175+ assert_eq ! ( 1 , channel. lines. len( ) ) ;
177176 }
178177
179178 #[ tokio:: test]
Original file line number Diff line number Diff line change @@ -224,8 +224,8 @@ mod test {
224224 ) ;
225225 assert_eq ! (
226226 vec![
227- "foo string = \" {" ,
228- " bar string = \" \" " ,
227+ "foo string = {" ,
228+ " bar string = " ,
229229 "}" ,
230230 ] ,
231231 lines
Original file line number Diff line number Diff line change @@ -14,12 +14,10 @@ use crossterm::event::KeyCode;
1414use crossterm:: event:: KeyModifiers ;
1515use ratatui:: layout:: Constraint ;
1616use ratatui:: layout:: Layout ;
17- use ratatui:: layout:: Offset ;
1817use ratatui:: layout:: Rect ;
1918use ratatui:: widgets:: Block ;
2019use ratatui:: widgets:: Borders ;
2120use ratatui:: widgets:: Clear ;
22- use ratatui:: widgets:: Tabs ;
2321use ratatui:: Frame ;
2422use std:: cell:: Cell ;
2523use std:: rc:: Rc ;
You can’t perform that action at this time.
0 commit comments