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 {
588
588
StatusType :: WorkingDir ,
589
589
None ,
590
590
)
591
- . unwrap ( ) ;
591
+ . expect ( "Could not get status" ) ;
592
592
593
593
let selected_branch = & self . branches [ self . selection as usize ] ;
594
594
if status. is_empty ( ) {
@@ -601,7 +601,7 @@ impl BranchListPopup {
601
601
} else {
602
602
checkout_remote_branch (
603
603
& self . repo . borrow ( ) ,
604
- & selected_branch,
604
+ selected_branch,
605
605
) ?;
606
606
self . local = true ;
607
607
self . update_branches ( ) ?;
@@ -610,7 +610,7 @@ impl BranchListPopup {
610
610
} else {
611
611
self . queue . push ( InternalEvent :: CheckoutOption (
612
612
selected_branch. clone ( ) ,
613
- self . local . clone ( ) ,
613
+ self . local ,
614
614
) ) ;
615
615
}
616
616
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ impl CheckoutOptionPopup {
61
61
self . theme. text( true , false ) ,
62
62
) ,
63
63
Span :: styled(
64
- self . branch. as_ref( ) . unwrap ( ) . name. clone( ) ,
64
+ self . branch. as_ref( ) . expect ( "No branch" ) . name. clone( ) ,
65
65
self . theme. commit_hash( false ) ,
66
66
) ,
67
67
] ) ) ;
@@ -99,12 +99,12 @@ impl CheckoutOptionPopup {
99
99
if self . local {
100
100
checkout_branch (
101
101
& self . repo ,
102
- & self . branch . as_ref ( ) . unwrap ( ) . name ,
103
- ) ?
102
+ & self . branch . as_ref ( ) . expect ( "No branch" ) . name ,
103
+ ) ?;
104
104
} else {
105
105
checkout_remote_branch (
106
106
& self . repo ,
107
- & self . branch . as_ref ( ) . unwrap ( ) ,
107
+ self . branch . as_ref ( ) . expect ( "No branch" ) ,
108
108
) ?;
109
109
}
110
110
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> {
438
438
}
439
439
}
440
440
441
- #[ derive( PartialEq , Clone , Copy ) ]
441
+ #[ derive( PartialEq , Eq , Clone , Copy ) ]
442
442
pub enum CheckoutOptions {
443
443
StashAndReapply ,
444
444
Unchange ,
445
445
Discard ,
446
446
}
447
447
448
- pub fn checkout_option_to_string (
448
+ pub const fn checkout_option_to_string (
449
449
kind : CheckoutOptions ,
450
450
) -> ( & ' static str , & ' static str ) {
451
451
const CHECKOUT_OPTION_STASH_AND_REAPPLY : & str =
You can’t perform that action at this time.
0 commit comments