Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "uptime-checker"
version = "0.1.0"
edition = "2021"
rust-version = "1.80"
rust-version = "1.85"

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

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.80-alpine3.20 as builder
FROM rust:1.85-alpine3.20 as builder

# Install system dependencies
RUN apk add --no-cache \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.localdev
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# so you can test your changes without having to rebuild the container.
##

FROM rust:1.80-alpine3.20 as builder
FROM rust:1.85-alpine3.20 as builder

ARG UPTIME_CHECKER_GIT_REVISION
ENV UPTIME_CHECKER_GIT_REVISION=$UPTIME_CHECKER_GIT_REVISION
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ fn emit_version() {
.unwrap_or("unknown-rev".to_string())
});

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

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn execute() -> io::Result<()> {
match result {
None => panic!("tasks_finished channel unexpectedly closed"),
Some(Err(err)) => {
panic!("Error in partition: {:?}", err);
panic!("Error in partition: {err:?}");
},
_ => panic!("Unexpected end of task"),
}
Expand Down
4 changes: 2 additions & 2 deletions src/check_config_provider/redis_config_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ impl RedisPartition {
pub fn new(number: u16) -> RedisPartition {
RedisPartition {
number,
config_key: format!("uptime:configs:{}", number),
update_key: format!("uptime:updates:{}", number),
config_key: format!("uptime:configs:{number}"),
update_key: format!("uptime:updates:{number}"),
}
}
}
Expand Down
22 changes: 8 additions & 14 deletions src/checker/isahc_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl Checker for IsahcChecker {
tracing::info!("check_url.error: {:?}", error_msg);
CheckStatusReason {
status_type: CheckStatusReasonType::Failure,
description: format!("{:?}", error_msg),
description: format!("{error_msg:?}"),
}
}
}
Expand Down Expand Up @@ -758,26 +758,22 @@ mod tests {
assert_eq!(
result.status,
CheckStatus::Failure,
"Test case: {:?}",
&cert_type
"Test case: {cert_type:?}",
);
assert_eq!(
result.request_info.and_then(|i| i.http_status_code),
None,
"Test case: {:?}",
cert_type
"Test case: {cert_type:?}",
);
assert_eq!(
result.status_reason.as_ref().map(|r| r.status_type),
Some(CheckStatusReasonType::TlsError),
"Test case: {:?}",
cert_type
"Test case: {cert_type:?}",
);
assert_eq!(
result.status_reason.map(|r| r.description).unwrap(),
expected_msg,
"Test case: {:?}",
cert_type
"Test case: {cert_type:?}",
);
}
}
Expand Down Expand Up @@ -888,8 +884,7 @@ mod tests {
let result_description = result.status_reason.map(|r| r.description).unwrap();
assert_eq!(
result_description, "unknown error",
"Expected error message about closed connection: {}",
result_description
"Expected error message about closed connection: {result_description}",
);
}

Expand Down Expand Up @@ -919,7 +914,7 @@ mod tests {
};
let check = ScheduledCheck::new_for_test(tick, config);
let result = checker.check_url(&check, "us-west").await;
eprintln!("{:?}", result);
eprintln!("{result:?}");

assert_eq!(result.status, CheckStatus::Failure);
assert_eq!(result.request_info.and_then(|i| i.http_status_code), None);
Expand All @@ -930,8 +925,7 @@ mod tests {
let result_description = result.status_reason.map(|r| r.description).unwrap();
assert_eq!(
result_description, "unknown error",
"Expected error message about closed connection: {}",
result_description
"Expected error message about closed connection: {result_description}"
);
}
}
16 changes: 6 additions & 10 deletions src/checker/reqwest_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn dns_error(err: &reqwest::Error) -> Option<String> {
inner = source;

if let Some(inner_err) = source.downcast_ref::<hickory_resolver::error::ResolveError>() {
return Some(format!("{}", inner_err));
return Some(format!("{inner_err}"));
}
}
None
Expand Down Expand Up @@ -348,7 +348,7 @@ impl Checker for ReqwestChecker {
tracing::info!("check_url.error: {:?}", error_msg);
CheckStatusReason {
status_type: CheckStatusReasonType::Failure,
description: format!("{:?}", error_msg),
description: format!("{error_msg:?}"),
}
}
}),
Expand Down Expand Up @@ -814,26 +814,22 @@ mod tests {
assert_eq!(
result.status,
CheckStatus::Failure,
"Test case: {:?}",
&cert_type
"Test case: {cert_type:?}",
);
assert_eq!(
result.request_info.and_then(|i| i.http_status_code),
None,
"Test case: {:?}",
cert_type
"Test case: {cert_type:?}",
);
assert_eq!(
result.status_reason.as_ref().map(|r| r.status_type),
Some(CheckStatusReasonType::TlsError),
"Test case: {:?}",
cert_type
"Test case: {cert_type:?}",
);
assert_eq!(
result.status_reason.map(|r| r.description).unwrap(),
expected_msg,
"Test case: {:?}",
cert_type
"Test case: {cert_type:?}",
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct PartitionedService {
}

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

impl PartitionedService {
Expand Down
5 changes: 1 addition & 4 deletions src/types/check_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,7 @@ mod tests {
for other_region in should_run_order.iter().filter(|&&r| r != expected_region) {
assert!(
!config.should_run(tick, other_region),
"Subscription {} should not run in region {} at tick {}",
subscription_id,
other_region,
tick
"Subscription {subscription_id} should not run in region {other_region} at tick {tick}"
);
}
}
Expand Down