File tree Expand file tree Collapse file tree 7 files changed +7
-9
lines changed
Expand file tree Collapse file tree 7 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ pub struct AsyncLog {
4949
5050static LIMIT_COUNT : usize = 3000 ;
5151static SLEEP_FOREGROUND : Duration = Duration :: from_millis ( 2 ) ;
52- static SLEEP_BACKGROUND : Duration = Duration :: from_millis ( 1000 ) ;
52+ static SLEEP_BACKGROUND : Duration = Duration :: from_secs ( 1 ) ;
5353
5454impl AsyncLog {
5555 ///
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ pub fn get_tags_with_metadata(
141141 } )
142142 . collect ( ) ;
143143
144- tags. sort_unstable_by ( |a , b| b . time . cmp ( & a . time ) ) ;
144+ tags. sort_unstable_by_key ( | b| std :: cmp:: Reverse ( b . time ) ) ;
145145
146146 Ok ( tags)
147147}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use std::{
1212} ;
1313
1414static FAST_POLL_DURATION : Duration = Duration :: from_millis ( 100 ) ;
15- static SLOW_POLL_DURATION : Duration = Duration :: from_millis ( 10000 ) ;
15+ static SLOW_POLL_DURATION : Duration = Duration :: from_secs ( 10 ) ;
1616
1717///
1818#[ derive( Clone , Copy , Debug ) ]
Original file line number Diff line number Diff line change @@ -307,8 +307,7 @@ impl BranchListPopup {
307307 if self . visible {
308308 self . has_remotes =
309309 get_branches_info ( & self . repo . borrow ( ) , false )
310- . map ( |branches| !branches. is_empty ( ) )
311- . unwrap_or ( false ) ;
310+ . is_ok_and ( |branches| !branches. is_empty ( ) ) ;
312311 }
313312 }
314313
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ impl ResetPopup {
120120 ///
121121 #[ allow( clippy:: unnecessary_wraps) ]
122122 pub fn update ( & mut self ) -> Result < ( ) > {
123- self . git_branch_name . lookup ( ) . map ( Some ) . unwrap_or ( None ) ;
123+ self . git_branch_name . lookup ( ) . ok ( ) ;
124124
125125 Ok ( ( ) )
126126 }
Original file line number Diff line number Diff line change @@ -312,8 +312,7 @@ impl TagListPopup {
312312
313313 self . has_remotes =
314314 sync:: get_branches_info ( & self . repo . borrow ( ) , false )
315- . map ( |branches| !branches. is_empty ( ) )
316- . unwrap_or ( false ) ;
315+ . is_ok_and ( |branches| !branches. is_empty ( ) ) ;
317316
318317 let basic_credential = if self . has_remotes {
319318 if need_username_password ( & self . repo . borrow ( ) ) ? {
Original file line number Diff line number Diff line change @@ -382,7 +382,7 @@ impl Status {
382382
383383 ///
384384 pub fn update ( & mut self ) -> Result < ( ) > {
385- self . git_branch_name . lookup ( ) . map ( Some ) . unwrap_or ( None ) ;
385+ let _ = self . git_branch_name . lookup ( ) . ok ( ) ;
386386
387387 if self . is_visible ( ) {
388388 let config =
You can’t perform that action at this time.
0 commit comments