File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -588,7 +588,7 @@ impl BranchListPopup {
588588 StatusType :: WorkingDir ,
589589 None ,
590590 )
591- . unwrap ( ) ;
591+ . expect ( "Could not get status" ) ;
592592
593593 let selected_branch = & self . branches [ self . selection as usize ] ;
594594 if status. is_empty ( ) {
@@ -601,7 +601,7 @@ impl BranchListPopup {
601601 } else {
602602 checkout_remote_branch (
603603 & self . repo . borrow ( ) ,
604- & selected_branch,
604+ selected_branch,
605605 ) ?;
606606 self . local = true ;
607607 self . update_branches ( ) ?;
@@ -610,7 +610,7 @@ impl BranchListPopup {
610610 } else {
611611 self . queue . push ( InternalEvent :: CheckoutOption (
612612 selected_branch. clone ( ) ,
613- self . local . clone ( ) ,
613+ self . local ,
614614 ) ) ;
615615 }
616616
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ impl CheckoutOptionPopup {
6161 self . theme. text( true , false ) ,
6262 ) ,
6363 Span :: styled(
64- self . branch. as_ref( ) . unwrap ( ) . name. clone( ) ,
64+ self . branch. as_ref( ) . expect ( "No branch" ) . name. clone( ) ,
6565 self . theme. commit_hash( false ) ,
6666 ) ,
6767 ] ) ) ;
@@ -99,12 +99,12 @@ impl CheckoutOptionPopup {
9999 if self . local {
100100 checkout_branch (
101101 & self . repo ,
102- & self . branch . as_ref ( ) . unwrap ( ) . name ,
103- ) ?
102+ & self . branch . as_ref ( ) . expect ( "No branch" ) . name ,
103+ ) ?;
104104 } else {
105105 checkout_remote_branch (
106106 & self . repo ,
107- & self . branch . as_ref ( ) . unwrap ( ) ,
107+ self . branch . as_ref ( ) . expect ( "No branch" ) ,
108108 ) ?;
109109 }
110110
Original file line number Diff line number Diff line change @@ -438,14 +438,14 @@ pub fn ellipsis_trim_start(s: &str, width: usize) -> Cow<str> {
438438 }
439439}
440440
441- #[ derive( PartialEq , Clone , Copy ) ]
441+ #[ derive( PartialEq , Eq , Clone , Copy ) ]
442442pub enum CheckoutOptions {
443443 StashAndReapply ,
444444 Unchange ,
445445 Discard ,
446446}
447447
448- pub fn checkout_option_to_string (
448+ pub const fn checkout_option_to_string (
449449 kind : CheckoutOptions ,
450450) -> ( & ' static str , & ' static str ) {
451451 const CHECKOUT_OPTION_STASH_AND_REAPPLY : & str =
You can’t perform that action at this time.
0 commit comments