mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-04 07:17:50 +00:00
chore: more linting
This commit is contained in:
14
src/http.rs
14
src/http.rs
@@ -64,8 +64,8 @@ pub async fn rating_request(
|
|||||||
let latency = start.elapsed();
|
let latency = start.elapsed();
|
||||||
|
|
||||||
if let Err(e) = &res {
|
if let Err(e) = &res {
|
||||||
error!("Failed to get {}: {} (after {:?})", url, e, latency);
|
error!("Failed to get {url}: {e} (after {latency:?})");
|
||||||
return Err(format!("Failed to get {} {} (after {:?})", url, e, latency).into());
|
return Err(format!("Failed to get {url} {e} (after {latency:?})").into());
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = res.unwrap();
|
let res = res.unwrap();
|
||||||
@@ -74,17 +74,11 @@ pub async fn rating_request(
|
|||||||
|
|
||||||
// We don't need the response body for rating
|
// We don't need the response body for rating
|
||||||
if let Err(e) = res.text().await {
|
if let Err(e) = res.text().await {
|
||||||
warn!(
|
warn!("Failed to get response text from {url}: {e} (after {latency:?})");
|
||||||
"Failed to get response text from {}: {} (after {:?})",
|
|
||||||
url, e, latency
|
|
||||||
);
|
|
||||||
return Err(e.into());
|
return Err(e.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
info!(
|
info!("Successfully rated {url} in {latency:?} (cloudflare: {is_cloudflare})");
|
||||||
"Successfully rated {} in {:?} (cloudflare: {})",
|
|
||||||
url, latency, is_cloudflare
|
|
||||||
);
|
|
||||||
Ok((latency, is_cloudflare))
|
Ok((latency, is_cloudflare))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ pub fn is_program_in_path(program: &str) -> bool {
|
|||||||
.and_then(|paths| {
|
.and_then(|paths| {
|
||||||
paths.to_str().map(|paths| {
|
paths.to_str().map(|paths| {
|
||||||
paths.split(';').any(|dir| {
|
paths.split(';').any(|dir| {
|
||||||
fs::metadata(format!("{}\\{}.exe", dir, program)).is_ok()
|
fs::metadata(format!("{dir}\\{program}.exe")).is_ok()
|
||||||
|| fs::metadata(format!("{dir}\\{program}.cmd")).is_ok()
|
|| fs::metadata(format!("{dir}\\{program}.cmd")).is_ok()
|
||||||
|| fs::metadata(format!("{dir}\\{program}.bat")).is_ok()
|
|| fs::metadata(format!("{dir}\\{program}.bat")).is_ok()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user