mirror of
https://codeberg.org/spire/dispenser.git
synced 2026-06-03 10:04:07 +02:00
clippy
This commit is contained in:
parent
76ba9682a5
commit
38f3b96e35
5 changed files with 38 additions and 18 deletions
17
src/main.rs
17
src/main.rs
|
|
@ -35,7 +35,7 @@ struct Args {
|
|||
config: String,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
#[derive(Subcommand, Default)]
|
||||
enum Commands {
|
||||
/// Start a new server if none is running
|
||||
Start,
|
||||
|
|
@ -44,15 +44,10 @@ enum Commands {
|
|||
/// List running servers
|
||||
List,
|
||||
/// Run the management daemon
|
||||
#[default]
|
||||
Daemon,
|
||||
}
|
||||
|
||||
impl Default for Commands {
|
||||
fn default() -> Self {
|
||||
Commands::Daemon
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
#[error("Error while interacting with cloud provider: {0}")]
|
||||
|
|
@ -360,9 +355,9 @@ async fn start(cloud: &dyn Cloud, config: &Config) -> Result<Server, Error> {
|
|||
|
||||
async fn set_dyndns(dns_config: DynDnsConfig, ip: IpAddr) {
|
||||
let dns = DynDnsClient::new(
|
||||
dns_config.update_url.to_string(),
|
||||
dns_config.username.to_string(),
|
||||
dns_config.password.to_string(),
|
||||
dns_config.update_url,
|
||||
dns_config.username,
|
||||
dns_config.password,
|
||||
);
|
||||
println!(
|
||||
"Updating DynDNS entry for {} to {}",
|
||||
|
|
@ -380,7 +375,7 @@ async fn connect_ssh(ip: IpAddr, auth: &CreatedAuth) -> Result<SshSession, Error
|
|||
tries += 1;
|
||||
sleep(Duration::from_secs(5)).await;
|
||||
|
||||
match SshSession::open(ip, &auth).await {
|
||||
match SshSession::open(ip, auth).await {
|
||||
Ok(ssh) => {
|
||||
return Ok(ssh);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue