From 5cf4b414f792881044ea06a5845733ce2397b5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Laitl?= Date: Fri, 13 Sep 2024 11:18:31 +0200 Subject: [PATCH] Fix dependency_on_unit_never_type_fallback lint This relates to - https://github.com/rust-lang/rust/issues/123748 - https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html And frankly I still don't really understand why never type was involved in our code in the first place. --- client/src/main.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index 282d1ef..145fc22 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -473,7 +473,7 @@ fn redeem_invite( "Registering keypair with server (at {}).", &config.server.internal_endpoint ); - Api::new(&config.server).http_form( + Api::new(&config.server).http_form::<_, ()>( "POST", "/user/redeem", RedeemContents { @@ -742,7 +742,7 @@ fn rename_cidr( .ok_or_else(|| anyhow!("CIDR not found."))? .id; - api.http_form("PUT", &format!("/admin/cidrs/{id}"), cidr_request)?; + api.http_form::<_, ()>("PUT", &format!("/admin/cidrs/{id}"), cidr_request)?; log::info!("CIDR renamed."); } else { log::info!("Exited without renaming CIDR."); @@ -766,7 +766,7 @@ fn delete_cidr( let cidr_id = prompts::delete_cidr(&cidrs, &peers, &sub_opts)?; println!("Deleting CIDR..."); - api.http("DELETE", &format!("/admin/cidrs/{cidr_id}"))?; + api.http::<()>("DELETE", &format!("/admin/cidrs/{cidr_id}"))?; println!("CIDR deleted."); @@ -842,7 +842,7 @@ fn rename_peer( .next() .ok_or_else(|| anyhow!("Peer not found."))?; - api.http_form("PUT", &format!("/admin/peers/{id}"), peer_request)?; + api.http_form::<_, ()>("PUT", &format!("/admin/peers/{id}"), peer_request)?; log::info!("Peer renamed."); } else { log::info!("exited without renaming peer."); @@ -867,7 +867,7 @@ fn enable_or_disable_peer( if let Some(peer) = prompts::enable_or_disable_peer(&peers[..], &sub_opts, enable)? { let Peer { id, mut contents } = peer; contents.is_disabled = !enable; - api.http_form("PUT", &format!("/admin/peers/{id}"), contents)?; + api.http_form::<_, ()>("PUT", &format!("/admin/peers/{id}"), contents)?; } else { log::info!("exiting without enabling or disabling peer."); } @@ -905,7 +905,7 @@ fn add_association( return Ok(()); }; - api.http_form( + api.http_form::<_, ()>( "POST", "/admin/associations", AssociationContents { @@ -934,7 +934,7 @@ fn delete_association( if let Some(association) = prompts::delete_association(&associations[..], &cidrs[..], &sub_opts)? { - api.http("DELETE", &format!("/admin/associations/{}", association.id))?; + api.http::<()>("DELETE", &format!("/admin/associations/{}", association.id))?; } else { log::info!("exiting without adding association."); } @@ -1016,7 +1016,7 @@ fn override_endpoint( if let Some(contents) = endpoint_contents { log::info!("requesting endpoint update..."); - Api::new(&config.server).http_form("PUT", "/user/endpoint", contents)?; + Api::new(&config.server).http_form::<_, ()>("PUT", "/user/endpoint", contents)?; log::info!( "endpoint override {}", if sub_opts.unset { "unset" } else { "set" }