Skip to content

Commit

Permalink
fix: apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
lleyton committed Feb 29, 2024
1 parent da8c2be commit 594aea6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/cloud/digitalocean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl Provisioner for DigitalOceanProvisioner {
)
})?;

let droplet = api.get_droplet_async(&droplet_id).await?;
let droplet = api.get_droplet_async(droplet_id).await?;

let mut status = status.clone();

Expand Down
4 changes: 2 additions & 2 deletions src/cloud/linode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl Provisioner for LinodeProvisioner {

debug!("Instance status: {:?}", instance.status);

if instance.ipv4.len() > 0 {
if !instance.ipv4.is_empty() {
break instance.ipv4[0].clone();
} else {
warn!("Waiting for instance to get IP address");
Expand Down Expand Up @@ -171,7 +171,7 @@ impl Provisioner for LinodeProvisioner {
Ok(status)
} else {
warn!("No instance status found, creating new instance");
return Ok(self.create_exit_node(auth.clone(), exit_node).await?);
return self.create_exit_node(auth.clone(), exit_node).await;
}
}
}
4 changes: 2 additions & 2 deletions src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ async fn reconcile_nodes(obj: Arc<ExitNode>, ctx: Arc<Context>) -> Result<Action
let secret = old_provisioner
.find_secret()
.await
.or_else(|_| Err(crate::error::ReconcileError::CloudProvisionerSecretNotFound))?
.map_err(|_| crate::error::ReconcileError::CloudProvisionerSecretNotFound)?
.ok_or(ReconcileError::CloudProvisionerSecretNotFound)?;

old_provisioner_api
Expand Down Expand Up @@ -602,7 +602,7 @@ async fn reconcile_nodes(obj: Arc<ExitNode>, ctx: Arc<Context>) -> Result<Action
let secret = provisioner
.find_secret()
.await
.or_else(|_| Err(crate::error::ReconcileError::CloudProvisionerSecretNotFound))?
.map_err(|_| crate::error::ReconcileError::CloudProvisionerSecretNotFound)?
.ok_or(ReconcileError::CloudProvisionerSecretNotFound)?;
finalizer::finalizer(
&exit_nodes.clone(),
Expand Down
8 changes: 4 additions & 4 deletions src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ pub fn generate_tunnel_args(svc: &Service) -> Result<Vec<String>, ReconcileError
.iter()
.map(|p| {
format!(
"{}:{}:{}:{}",
"{}:{}:{}.{}:{}",
target_ip,
p.port.to_string(),
format!("{}.{}", service_name, service_namespace),
p.port,
service_name,
service_namespace,
convert_service_port(p.clone())
)
})
Expand Down Expand Up @@ -223,7 +224,6 @@ pub async fn create_pod_template(
}],
..Default::default()
}),
..Default::default()
})
}

Expand Down

0 comments on commit 594aea6

Please sign in to comment.