Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
validator: clippy 0.1.70: 2023-03-18: Apply suggestions, disable fals…
Browse files Browse the repository at this point in the history
…e positives
  • Loading branch information
ilya-bobyr committed Mar 21, 2023
1 parent 1410ae5 commit 79c6840
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ pub fn main() {
("authorized-voter", Some(authorized_voter_subcommand_matches)) => {
match authorized_voter_subcommand_matches.subcommand() {
("add", Some(subcommand_matches)) => {
if let Some(authorized_voter_keypair) =
value_t!(subcommand_matches, "authorized_voter_keypair", String).ok()
if let Ok(authorized_voter_keypair) =
value_t!(subcommand_matches, "authorized_voter_keypair", String)
{
let authorized_voter_keypair = fs::canonicalize(&authorized_voter_keypair)
.unwrap_or_else(|err| {
Expand Down Expand Up @@ -558,7 +558,7 @@ pub fn main() {
return;
}
("unload", Some(subcommand_matches)) => {
if let Some(name) = value_t!(subcommand_matches, "name", String).ok() {
if let Ok(name) = value_t!(subcommand_matches, "name", String) {
let admin_client = admin_rpc_service::connect(&ledger_path);
admin_rpc_service::runtime()
.block_on(async {
Expand All @@ -573,7 +573,7 @@ pub fn main() {
return;
}
("load", Some(subcommand_matches)) => {
if let Some(config) = value_t!(subcommand_matches, "config", String).ok() {
if let Ok(config) = value_t!(subcommand_matches, "config", String) {
let admin_client = admin_rpc_service::connect(&ledger_path);
let name = admin_rpc_service::runtime()
.block_on(async {
Expand All @@ -588,8 +588,8 @@ pub fn main() {
return;
}
("reload", Some(subcommand_matches)) => {
if let Some(name) = value_t!(subcommand_matches, "name", String).ok() {
if let Some(config) = value_t!(subcommand_matches, "config", String).ok() {
if let Ok(name) = value_t!(subcommand_matches, "name", String) {
if let Ok(config) = value_t!(subcommand_matches, "config", String) {
let admin_client = admin_rpc_service::connect(&ledger_path);
admin_rpc_service::runtime()
.block_on(async {
Expand Down Expand Up @@ -698,7 +698,7 @@ pub fn main() {
("set-identity", Some(subcommand_matches)) => {
let require_tower = subcommand_matches.is_present("require_tower");

if let Some(identity_keypair) = value_t!(subcommand_matches, "identity", String).ok() {
if let Ok(identity_keypair) = value_t!(subcommand_matches, "identity", String) {
let identity_keypair = fs::canonicalize(&identity_keypair).unwrap_or_else(|err| {
println!("Unable to access path: {identity_keypair}: {err:?}");
exit(1);
Expand Down Expand Up @@ -1075,12 +1075,12 @@ pub fn main() {
started_from_validator: true, // this is the only place this is set
..AccountsIndexConfig::default()
};
if let Some(bins) = value_t!(matches, "accounts_index_bins", usize).ok() {
if let Ok(bins) = value_t!(matches, "accounts_index_bins", usize) {
accounts_index_config.bins = Some(bins);
}

accounts_index_config.index_limit_mb =
if let Some(limit) = value_t!(matches, "accounts_index_memory_limit_mb", usize).ok() {
if let Ok(limit) = value_t!(matches, "accounts_index_memory_limit_mb", usize) {
IndexLimitMb::Limit(limit)
} else if matches.is_present("disable_accounts_disk_index") {
IndexLimitMb::InMemOnly
Expand Down

0 comments on commit 79c6840

Please sign in to comment.