diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 541bcec..07d7528 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -7,7 +7,7 @@ license = "" repository = "https://github.com/Grasscutters/Cultivation.git" default-run = "cultivation" edition = "2021" -rust-version = "1.57" +rust-version = "1.58" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index e8c4732..3da7a7b 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -498,7 +498,7 @@ pub fn service_status(service: String) -> bool { } }; let status_result = my_service.query_status(); - if let Ok(..) = status_result { + if status_result.is_ok() { let status = status_result.unwrap(); println!("{} service status: {:?}", service, status.current_state); if status.current_state == Stopped { diff --git a/src-tauri/src/web.rs b/src-tauri/src/web.rs index 14fbce8..3a7863f 100644 --- a/src-tauri/src/web.rs +++ b/src-tauri/src/web.rs @@ -36,8 +36,8 @@ pub(crate) async fn valid_url(url: String) -> bool { .await .ok(); - if response.is_some() { - return response.unwrap().status().as_str() == "200"; + if let Some(thing) = response { + return thing.status().as_str() == "200"; } else { false }