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.
pull/321/head
Matěj Laitl 2024-09-13 11:18:31 +02:00
parent 7d8617b285
commit e1fb892366
1 changed files with 8 additions and 8 deletions

View File

@ -473,7 +473,7 @@ fn redeem_invite(
"Registering keypair with server (at {}).", "Registering keypair with server (at {}).",
&config.server.internal_endpoint &config.server.internal_endpoint
); );
Api::new(&config.server).http_form( Api::new(&config.server).http_form::<_, ()>(
"POST", "POST",
"/user/redeem", "/user/redeem",
RedeemContents { RedeemContents {
@ -742,7 +742,7 @@ fn rename_cidr(
.ok_or_else(|| anyhow!("CIDR not found."))? .ok_or_else(|| anyhow!("CIDR not found."))?
.id; .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."); log::info!("CIDR renamed.");
} else { } else {
log::info!("Exited without renaming CIDR."); log::info!("Exited without renaming CIDR.");
@ -766,7 +766,7 @@ fn delete_cidr(
let cidr_id = prompts::delete_cidr(&cidrs, &peers, &sub_opts)?; let cidr_id = prompts::delete_cidr(&cidrs, &peers, &sub_opts)?;
println!("Deleting CIDR..."); println!("Deleting CIDR...");
api.http("DELETE", &format!("/admin/cidrs/{cidr_id}"))?; api.http::<()>("DELETE", &format!("/admin/cidrs/{cidr_id}"))?;
println!("CIDR deleted."); println!("CIDR deleted.");
@ -842,7 +842,7 @@ fn rename_peer(
.next() .next()
.ok_or_else(|| anyhow!("Peer not found."))?; .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."); log::info!("Peer renamed.");
} else { } else {
log::info!("exited without renaming peer."); 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)? { if let Some(peer) = prompts::enable_or_disable_peer(&peers[..], &sub_opts, enable)? {
let Peer { id, mut contents } = peer; let Peer { id, mut contents } = peer;
contents.is_disabled = !enable; contents.is_disabled = !enable;
api.http_form("PUT", &format!("/admin/peers/{id}"), contents)?; api.http_form::<_, ()>("PUT", &format!("/admin/peers/{id}"), contents)?;
} else { } else {
log::info!("exiting without enabling or disabling peer."); log::info!("exiting without enabling or disabling peer.");
} }
@ -905,7 +905,7 @@ fn add_association(
return Ok(()); return Ok(());
}; };
api.http_form( api.http_form::<_, ()>(
"POST", "POST",
"/admin/associations", "/admin/associations",
AssociationContents { AssociationContents {
@ -934,7 +934,7 @@ fn delete_association(
if let Some(association) = if let Some(association) =
prompts::delete_association(&associations[..], &cidrs[..], &sub_opts)? prompts::delete_association(&associations[..], &cidrs[..], &sub_opts)?
{ {
api.http("DELETE", &format!("/admin/associations/{}", association.id))?; api.http::<()>("DELETE", &format!("/admin/associations/{}", association.id))?;
} else { } else {
log::info!("exiting without adding association."); log::info!("exiting without adding association.");
} }
@ -1016,7 +1016,7 @@ fn override_endpoint(
if let Some(contents) = endpoint_contents { if let Some(contents) = endpoint_contents {
log::info!("requesting endpoint update..."); 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!( log::info!(
"endpoint override {}", "endpoint override {}",
if sub_opts.unset { "unset" } else { "set" } if sub_opts.unset { "unset" } else { "set" }