@@ -446,29 +446,29 @@ pub enum CheckoutOptions {
446446}
447447
448448impl CheckoutOptions {
449- pub fn previous ( & self ) -> Self {
449+ pub const fn previous ( self ) -> Self {
450450 match self {
451- CheckoutOptions :: KeepLocalChanges => {
452- CheckoutOptions :: Discard
451+ Self :: KeepLocalChanges => {
452+ Self :: Discard
453453 }
454- CheckoutOptions :: Unchange => {
455- CheckoutOptions :: KeepLocalChanges
454+ Self :: Unchange => {
455+ Self :: KeepLocalChanges
456456 }
457- CheckoutOptions :: Discard => CheckoutOptions :: Unchange ,
457+ Self :: Discard => Self :: Unchange ,
458458 }
459459 }
460460
461- pub fn next ( & self ) -> Self {
461+ pub const fn next ( self ) -> Self {
462462 match self {
463- CheckoutOptions :: KeepLocalChanges => CheckoutOptions :: Unchange ,
464- CheckoutOptions :: Unchange => CheckoutOptions :: Discard ,
465- CheckoutOptions :: Discard => {
466- CheckoutOptions :: KeepLocalChanges
463+ Self :: KeepLocalChanges => Self :: Unchange ,
464+ Self :: Unchange => Self :: Discard ,
465+ Self :: Discard => {
466+ Self :: KeepLocalChanges
467467 }
468468 }
469469 }
470470
471- pub fn to_string_pair ( & self ) -> ( & ' static str , & ' static str ) {
471+ pub const fn to_string_pair ( self ) -> ( & ' static str , & ' static str ) {
472472 const CHECKOUT_OPTION_STASH_AND_REAPPLY : & str =
473473 " 🟢 Stash and reapply changes" ;
474474 const CHECKOUT_OPTION_UNCHANGE : & str =
@@ -477,14 +477,14 @@ impl CheckoutOptions {
477477 " 🔴 Discard all local changes" ;
478478
479479 match self {
480- CheckoutOptions :: KeepLocalChanges => (
480+ Self :: KeepLocalChanges => (
481481 "Stash and reapply" ,
482482 CHECKOUT_OPTION_STASH_AND_REAPPLY ,
483483 ) ,
484- CheckoutOptions :: Unchange => {
484+ Self :: Unchange => {
485485 ( "Don't change" , CHECKOUT_OPTION_UNCHANGE )
486486 }
487- CheckoutOptions :: Discard => {
487+ Self :: Discard => {
488488 ( "Discard" , CHECKOUT_OPTION_DISCARD )
489489 }
490490 }
0 commit comments