@@ -466,8 +466,8 @@ pub fn main() {
466
466
( "authorized-voter" , Some ( authorized_voter_subcommand_matches) ) => {
467
467
match authorized_voter_subcommand_matches. subcommand ( ) {
468
468
( "add" , Some ( subcommand_matches) ) => {
469
- if let Some ( authorized_voter_keypair) =
470
- value_t ! ( subcommand_matches, "authorized_voter_keypair" , String ) . ok ( )
469
+ if let Ok ( authorized_voter_keypair) =
470
+ value_t ! ( subcommand_matches, "authorized_voter_keypair" , String )
471
471
{
472
472
let authorized_voter_keypair = fs:: canonicalize ( & authorized_voter_keypair)
473
473
. unwrap_or_else ( |err| {
@@ -562,7 +562,7 @@ pub fn main() {
562
562
return ;
563
563
}
564
564
( "unload" , Some ( subcommand_matches) ) => {
565
- if let Some ( name) = value_t ! ( subcommand_matches, "name" , String ) . ok ( ) {
565
+ if let Ok ( name) = value_t ! ( subcommand_matches, "name" , String ) {
566
566
let admin_client = admin_rpc_service:: connect ( & ledger_path) ;
567
567
admin_rpc_service:: runtime ( )
568
568
. block_on ( async {
@@ -577,7 +577,7 @@ pub fn main() {
577
577
return ;
578
578
}
579
579
( "load" , Some ( subcommand_matches) ) => {
580
- if let Some ( config) = value_t ! ( subcommand_matches, "config" , String ) . ok ( ) {
580
+ if let Ok ( config) = value_t ! ( subcommand_matches, "config" , String ) {
581
581
let admin_client = admin_rpc_service:: connect ( & ledger_path) ;
582
582
let name = admin_rpc_service:: runtime ( )
583
583
. block_on ( async {
@@ -592,8 +592,8 @@ pub fn main() {
592
592
return ;
593
593
}
594
594
( "reload" , Some ( subcommand_matches) ) => {
595
- if let Some ( name) = value_t ! ( subcommand_matches, "name" , String ) . ok ( ) {
596
- if let Some ( config) = value_t ! ( subcommand_matches, "config" , String ) . ok ( ) {
595
+ if let Ok ( name) = value_t ! ( subcommand_matches, "name" , String ) {
596
+ if let Ok ( config) = value_t ! ( subcommand_matches, "config" , String ) {
597
597
let admin_client = admin_rpc_service:: connect ( & ledger_path) ;
598
598
admin_rpc_service:: runtime ( )
599
599
. block_on ( async {
@@ -702,7 +702,7 @@ pub fn main() {
702
702
( "set-identity" , Some ( subcommand_matches) ) => {
703
703
let require_tower = subcommand_matches. is_present ( "require_tower" ) ;
704
704
705
- if let Some ( identity_keypair) = value_t ! ( subcommand_matches, "identity" , String ) . ok ( ) {
705
+ if let Ok ( identity_keypair) = value_t ! ( subcommand_matches, "identity" , String ) {
706
706
let identity_keypair = fs:: canonicalize ( & identity_keypair) . unwrap_or_else ( |err| {
707
707
println ! ( "Unable to access path: {identity_keypair}: {err:?}" ) ;
708
708
exit ( 1 ) ;
@@ -1115,12 +1115,12 @@ pub fn main() {
1115
1115
started_from_validator : true , // this is the only place this is set
1116
1116
..AccountsIndexConfig :: default ( )
1117
1117
} ;
1118
- if let Some ( bins) = value_t ! ( matches, "accounts_index_bins" , usize ) . ok ( ) {
1118
+ if let Ok ( bins) = value_t ! ( matches, "accounts_index_bins" , usize ) {
1119
1119
accounts_index_config. bins = Some ( bins) ;
1120
1120
}
1121
1121
1122
1122
accounts_index_config. index_limit_mb =
1123
- if let Some ( limit) = value_t ! ( matches, "accounts_index_memory_limit_mb" , usize ) . ok ( ) {
1123
+ if let Ok ( limit) = value_t ! ( matches, "accounts_index_memory_limit_mb" , usize ) {
1124
1124
IndexLimitMb :: Limit ( limit)
1125
1125
} else if matches. is_present ( "disable_accounts_disk_index" ) {
1126
1126
IndexLimitMb :: InMemOnly
0 commit comments