Skip to content

Commit

Permalink
clippy: rust 1.84.0 auto fixes (#4379)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Jan 10, 2025
1 parent 57ea0f6 commit c79cbf7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cli-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl Config {
return "".to_string();
}
let json_rpc_url = json_rpc_url.unwrap();
let is_secure = json_rpc_url.scheme().to_ascii_lowercase() == "https";
let is_secure = json_rpc_url.scheme().eq_ignore_ascii_case("https");
let mut ws_url = json_rpc_url.clone();
ws_url
.set_scheme(if is_secure { "wss" } else { "ws" })
Expand Down
3 changes: 1 addition & 2 deletions core/src/system_monitor_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ impl SystemMonitorService {
) -> bool {
current_limits
.iter()
.map(|(key, interesting_limit, current_value)| {
.all(|(key, interesting_limit, current_value)| {
datapoint_warn!("os-config", (key, *current_value, i64));
match interesting_limit {
InterestingLimit::Recommend(recommended_value)
Expand All @@ -477,7 +477,6 @@ impl SystemMonitorService {
}
}
})
.all(|good| good)
}

#[cfg(not(target_os = "linux"))]
Expand Down
2 changes: 1 addition & 1 deletion core/src/voting_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn send_vote_transaction(
.my_contact_info()
.tpu(connection_cache.protocol())
})
.ok_or_else(|| SendVoteError::InvalidTpuAddress)?;
.ok_or(SendVoteError::InvalidTpuAddress)?;
let buf = serialize(transaction)?;
let client = connection_cache.get_connection(&tpu);

Expand Down
2 changes: 1 addition & 1 deletion rpc-test/tests/nonblocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async fn test_tpu_send_transaction() {
.get_signature_statuses(&signatures)
.await
.unwrap();
if statuses.value.first().is_some() {
if !statuses.value.is_empty() {
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion rpc-test/tests/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ fn run_tpu_send_transaction(tpu_use_quic: bool) {
loop {
assert!(now.elapsed() < timeout);
let statuses = rpc_client.get_signature_statuses(&signatures).unwrap();
if statuses.value.first().is_some() {
if !statuses.value.is_empty() {
return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions turbine/src/broadcast_stage/broadcast_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ pub(super) fn get_chained_merkle_root_from_parent(
debug_assert!(parent < slot, "parent: {parent} >= slot: {slot}");
let index = blockstore
.meta(parent)?
.ok_or_else(|| Error::UnknownSlotMeta(parent))?
.ok_or(Error::UnknownSlotMeta(parent))?
.last_index
.ok_or_else(|| Error::UnknownLastIndex(parent))?;
.ok_or(Error::UnknownLastIndex(parent))?;
let shred = blockstore
.get_data_shred(parent, index)?
.ok_or(Error::ShredNotFound {
Expand Down
4 changes: 2 additions & 2 deletions validator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,7 @@ fn hash_validator(hash: String) -> Result<(), String> {
/// Test validator
pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<'a, 'a> {
return App::new("solana-test-validator")
App::new("solana-test-validator")
.about("Test Validator")
.version(version)
.arg({
Expand Down Expand Up @@ -2904,7 +2904,7 @@ pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<
argument in the genesis configuration. If the ledger \
already exists then this parameter is silently ignored",
),
);
)
}

pub struct DefaultTestArgs {
Expand Down
4 changes: 2 additions & 2 deletions vortexor/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn port_range_validator(port_range: String) -> Result<(), String> {
}

pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
return App::new(crate_name!())
App::new(crate_name!())
.about(crate_description!())
.version(version)
.global_setting(AppSettings::ColoredHelp)
Expand Down Expand Up @@ -173,5 +173,5 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
.takes_value(true)
.validator(is_parsable::<u64>)
.help("Milliseconds to wait in the TPU receiver for packet coalescing."),
);
)
}

0 comments on commit c79cbf7

Please sign in to comment.