Skip to content

Commit 4774a6a

Browse files
authored
chore: bump Rust toolchain version to 1.85 (#325)
Bumps the Rust version to 1.85 and fixes the new lints. Needed for #324
1 parent 625e1fc commit 4774a6a

File tree

10 files changed

+24
-37
lines changed

10 files changed

+24
-37
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "uptime-checker"
33
version = "0.1.0"
44
edition = "2021"
5-
rust-version = "1.80"
5+
rust-version = "1.85"
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.80-alpine3.20 as builder
1+
FROM rust:1.85-alpine3.20 as builder
22

33
# Install system dependencies
44
RUN apk add --no-cache \

Dockerfile.localdev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# so you can test your changes without having to rebuild the container.
1212
##
1313

14-
FROM rust:1.80-alpine3.20 as builder
14+
FROM rust:1.85-alpine3.20 as builder
1515

1616
ARG UPTIME_CHECKER_GIT_REVISION
1717
ENV UPTIME_CHECKER_GIT_REVISION=$UPTIME_CHECKER_GIT_REVISION

build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ fn emit_version() {
1515
.unwrap_or("unknown-rev".to_string())
1616
});
1717

18-
let release_name = format!("{}@{}+{}", package_name, package_version, git_commit_sha);
19-
println!("cargo:rustc-env=UPTIME_CHECKER_VERSION={}", release_name);
18+
let release_name = format!("{package_name}@{package_version}+{git_commit_sha}");
19+
println!("cargo:rustc-env=UPTIME_CHECKER_VERSION={release_name}");
2020
}
2121

2222
fn main() {

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn execute() -> io::Result<()> {
4444
match result {
4545
None => panic!("tasks_finished channel unexpectedly closed"),
4646
Some(Err(err)) => {
47-
panic!("Error in partition: {:?}", err);
47+
panic!("Error in partition: {err:?}");
4848
},
4949
_ => panic!("Unexpected end of task"),
5050
}

src/check_config_provider/redis_config_provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ impl RedisPartition {
2626
pub fn new(number: u16) -> RedisPartition {
2727
RedisPartition {
2828
number,
29-
config_key: format!("uptime:configs:{}", number),
30-
update_key: format!("uptime:updates:{}", number),
29+
config_key: format!("uptime:configs:{number}"),
30+
update_key: format!("uptime:updates:{number}"),
3131
}
3232
}
3333
}

src/checker/isahc_checker.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl Checker for IsahcChecker {
241241
tracing::info!("check_url.error: {:?}", error_msg);
242242
CheckStatusReason {
243243
status_type: CheckStatusReasonType::Failure,
244-
description: format!("{:?}", error_msg),
244+
description: format!("{error_msg:?}"),
245245
}
246246
}
247247
}
@@ -758,26 +758,22 @@ mod tests {
758758
assert_eq!(
759759
result.status,
760760
CheckStatus::Failure,
761-
"Test case: {:?}",
762-
&cert_type
761+
"Test case: {cert_type:?}",
763762
);
764763
assert_eq!(
765764
result.request_info.and_then(|i| i.http_status_code),
766765
None,
767-
"Test case: {:?}",
768-
cert_type
766+
"Test case: {cert_type:?}",
769767
);
770768
assert_eq!(
771769
result.status_reason.as_ref().map(|r| r.status_type),
772770
Some(CheckStatusReasonType::TlsError),
773-
"Test case: {:?}",
774-
cert_type
771+
"Test case: {cert_type:?}",
775772
);
776773
assert_eq!(
777774
result.status_reason.map(|r| r.description).unwrap(),
778775
expected_msg,
779-
"Test case: {:?}",
780-
cert_type
776+
"Test case: {cert_type:?}",
781777
);
782778
}
783779
}
@@ -888,8 +884,7 @@ mod tests {
888884
let result_description = result.status_reason.map(|r| r.description).unwrap();
889885
assert_eq!(
890886
result_description, "unknown error",
891-
"Expected error message about closed connection: {}",
892-
result_description
887+
"Expected error message about closed connection: {result_description}",
893888
);
894889
}
895890

@@ -919,7 +914,7 @@ mod tests {
919914
};
920915
let check = ScheduledCheck::new_for_test(tick, config);
921916
let result = checker.check_url(&check, "us-west").await;
922-
eprintln!("{:?}", result);
917+
eprintln!("{result:?}");
923918

924919
assert_eq!(result.status, CheckStatus::Failure);
925920
assert_eq!(result.request_info.and_then(|i| i.http_status_code), None);
@@ -930,8 +925,7 @@ mod tests {
930925
let result_description = result.status_reason.map(|r| r.description).unwrap();
931926
assert_eq!(
932927
result_description, "unknown error",
933-
"Expected error message about closed connection: {}",
934-
result_description
928+
"Expected error message about closed connection: {result_description}"
935929
);
936930
}
937931
}

src/checker/reqwest_checker.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn dns_error(err: &reqwest::Error) -> Option<String> {
9595
inner = source;
9696

9797
if let Some(inner_err) = source.downcast_ref::<hickory_resolver::error::ResolveError>() {
98-
return Some(format!("{}", inner_err));
98+
return Some(format!("{inner_err}"));
9999
}
100100
}
101101
None
@@ -348,7 +348,7 @@ impl Checker for ReqwestChecker {
348348
tracing::info!("check_url.error: {:?}", error_msg);
349349
CheckStatusReason {
350350
status_type: CheckStatusReasonType::Failure,
351-
description: format!("{:?}", error_msg),
351+
description: format!("{error_msg:?}"),
352352
}
353353
}
354354
}),
@@ -814,26 +814,22 @@ mod tests {
814814
assert_eq!(
815815
result.status,
816816
CheckStatus::Failure,
817-
"Test case: {:?}",
818-
&cert_type
817+
"Test case: {cert_type:?}",
819818
);
820819
assert_eq!(
821820
result.request_info.and_then(|i| i.http_status_code),
822821
None,
823-
"Test case: {:?}",
824-
cert_type
822+
"Test case: {cert_type:?}",
825823
);
826824
assert_eq!(
827825
result.status_reason.as_ref().map(|r| r.status_type),
828826
Some(CheckStatusReasonType::TlsError),
829-
"Test case: {:?}",
830-
cert_type
827+
"Test case: {cert_type:?}",
831828
);
832829
assert_eq!(
833830
result.status_reason.map(|r| r.description).unwrap(),
834831
expected_msg,
835-
"Test case: {:?}",
836-
cert_type
832+
"Test case: {cert_type:?}",
837833
);
838834
}
839835
}

src/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct PartitionedService {
3737
}
3838

3939
pub fn build_progress_key(partition: u16) -> String {
40-
format!("scheduler_process::{}", partition).to_string()
40+
format!("scheduler_process::{partition}").to_string()
4141
}
4242

4343
impl PartitionedService {

src/types/check_config.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,7 @@ mod tests {
683683
for other_region in should_run_order.iter().filter(|&&r| r != expected_region) {
684684
assert!(
685685
!config.should_run(tick, other_region),
686-
"Subscription {} should not run in region {} at tick {}",
687-
subscription_id,
688-
other_region,
689-
tick
686+
"Subscription {subscription_id} should not run in region {other_region} at tick {tick}"
690687
);
691688
}
692689
}

0 commit comments

Comments
 (0)