Skip to content

Commit c79cbf7

Browse files
authored
clippy: rust 1.84.0 auto fixes (anza-xyz#4379)
1 parent 57ea0f6 commit c79cbf7

File tree

8 files changed

+11
-12
lines changed

8 files changed

+11
-12
lines changed

cli-config/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl Config {
135135
return "".to_string();
136136
}
137137
let json_rpc_url = json_rpc_url.unwrap();
138-
let is_secure = json_rpc_url.scheme().to_ascii_lowercase() == "https";
138+
let is_secure = json_rpc_url.scheme().eq_ignore_ascii_case("https");
139139
let mut ws_url = json_rpc_url.clone();
140140
ws_url
141141
.set_scheme(if is_secure { "wss" } else { "ws" })

core/src/system_monitor_service.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ impl SystemMonitorService {
455455
) -> bool {
456456
current_limits
457457
.iter()
458-
.map(|(key, interesting_limit, current_value)| {
458+
.all(|(key, interesting_limit, current_value)| {
459459
datapoint_warn!("os-config", (key, *current_value, i64));
460460
match interesting_limit {
461461
InterestingLimit::Recommend(recommended_value)
@@ -477,7 +477,6 @@ impl SystemMonitorService {
477477
}
478478
}
479479
})
480-
.all(|good| good)
481480
}
482481

483482
#[cfg(not(target_os = "linux"))]

core/src/voting_service.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn send_vote_transaction(
6666
.my_contact_info()
6767
.tpu(connection_cache.protocol())
6868
})
69-
.ok_or_else(|| SendVoteError::InvalidTpuAddress)?;
69+
.ok_or(SendVoteError::InvalidTpuAddress)?;
7070
let buf = serialize(transaction)?;
7171
let client = connection_cache.get_connection(&tpu);
7272

rpc-test/tests/nonblocking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async fn test_tpu_send_transaction() {
4040
.get_signature_statuses(&signatures)
4141
.await
4242
.unwrap();
43-
if statuses.value.first().is_some() {
43+
if !statuses.value.is_empty() {
4444
break;
4545
}
4646
}

rpc-test/tests/rpc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ fn run_tpu_send_transaction(tpu_use_quic: bool) {
535535
loop {
536536
assert!(now.elapsed() < timeout);
537537
let statuses = rpc_client.get_signature_statuses(&signatures).unwrap();
538-
if statuses.value.first().is_some() {
538+
if !statuses.value.is_empty() {
539539
return;
540540
}
541541
}

turbine/src/broadcast_stage/broadcast_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ pub(super) fn get_chained_merkle_root_from_parent(
104104
debug_assert!(parent < slot, "parent: {parent} >= slot: {slot}");
105105
let index = blockstore
106106
.meta(parent)?
107-
.ok_or_else(|| Error::UnknownSlotMeta(parent))?
107+
.ok_or(Error::UnknownSlotMeta(parent))?
108108
.last_index
109-
.ok_or_else(|| Error::UnknownLastIndex(parent))?;
109+
.ok_or(Error::UnknownLastIndex(parent))?;
110110
let shred = blockstore
111111
.get_data_shred(parent, index)?
112112
.ok_or(Error::ShredNotFound {

validator/src/cli.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2453,7 +2453,7 @@ fn hash_validator(hash: String) -> Result<(), String> {
24532453
/// Test validator
24542454
24552455
pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<'a, 'a> {
2456-
return App::new("solana-test-validator")
2456+
App::new("solana-test-validator")
24572457
.about("Test Validator")
24582458
.version(version)
24592459
.arg({
@@ -2904,7 +2904,7 @@ pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<
29042904
argument in the genesis configuration. If the ledger \
29052905
already exists then this parameter is silently ignored",
29062906
),
2907-
);
2907+
)
29082908
}
29092909

29102910
pub struct DefaultTestArgs {

vortexor/src/cli.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn port_range_validator(port_range: String) -> Result<(), String> {
6666
}
6767

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

0 commit comments

Comments
 (0)