File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -469,23 +469,19 @@ impl<'a> Pager<'a> {
469469
470470 fn should_close ( & mut self ) -> bool {
471471 self . upper_mark
472- . saturating_add ( self . content_rows . into ( ) )
472+ . saturating_add ( self . content_rows )
473473 . ge ( & self . line_count )
474474 }
475475
476476 fn page_down ( & mut self ) {
477477 // If the next page down position __after redraw__ is greater than the total line count,
478478 // the upper mark must not grow past top of the screen at the end of the open file.
479- if self
480- . upper_mark
481- . saturating_add ( self . content_rows * 2 )
482- >= self . line_count
483- {
479+ if self . upper_mark . saturating_add ( self . content_rows * 2 ) >= self . line_count {
484480 self . upper_mark = self . line_count - self . content_rows ;
485481 return ;
486482 }
487483
488- self . upper_mark = self . upper_mark . saturating_add ( self . content_rows . into ( ) ) ;
484+ self . upper_mark = self . upper_mark . saturating_add ( self . content_rows ) ;
489485 }
490486
491487 fn page_up ( & mut self ) {
@@ -524,7 +520,7 @@ impl<'a> Pager<'a> {
524520 self . draw_lines ( stdout) ;
525521 let lower_mark = self
526522 . line_count
527- . min ( self . upper_mark . saturating_add ( self . content_rows . into ( ) ) ) ;
523+ . min ( self . upper_mark . saturating_add ( self . content_rows ) ) ;
528524 self . draw_prompt ( stdout, lower_mark, wrong_key) ;
529525 stdout. flush ( ) . unwrap ( ) ;
530526 }
You can’t perform that action at this time.
0 commit comments