File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -834,7 +834,7 @@ fn process_input_char(
834834 eprint ! ( "\x1B [{};H\x1B [K" , * top_line + 1 ) ;
835835 * top_line += 1 ;
836836
837- if * top_line >= split_row. checked_sub ( 1 ) . unwrap_or ( 0 ) {
837+ if * top_line >= split_row. saturating_sub ( 1 ) {
838838 eprint ! ( "\x1B [{};H" , 2 ) ;
839839 * top_line = 2 ;
840840 }
@@ -1331,12 +1331,8 @@ fn draw_terminal(split_row: u16, width: u16) -> io::Result<io::StdoutLock<'stati
13311331 // Move the cursor to the split row and draw the split line.
13321332 write ! ( handle, "\x1b [{};0H" , split_row) ?;
13331333 // Draw the horizontal split line (─) across the width of the terminal.
1334- writeln ! (
1335- handle,
1336- "└{:─<width$}┘" ,
1337- "" ,
1338- width = ( width as usize ) . checked_sub( 2 ) . unwrap_or( 0 )
1339- ) ?;
1334+ let width = usize:: from ( width. saturating_sub ( 2 ) ) ;
1335+ writeln ! ( handle, "└{:─<width$}┘" , "" , width = width) ?;
13401336 // Move the cursor back to the top-left corner and then down by one line.
13411337 write ! ( handle, "\x1b [1;H" ) ?;
13421338 write ! ( handle, "\x1B [1B" ) ?;
You can’t perform that action at this time.
0 commit comments