From 504edae9c4fab004c7c279d66ab6d7de2b8b588a Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Fri, 23 Jun 2023 10:20:25 -0700 Subject: [PATCH] cargo fmt Signed-off-by: Matthew Fisher --- src/commands/deploy.rs | 15 +++++++-------- src/commands/login.rs | 13 ++++++------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/commands/deploy.rs b/src/commands/deploy.rs index 2b34359..9bd4d20 100644 --- a/src/commands/deploy.rs +++ b/src/commands/deploy.rs @@ -176,12 +176,8 @@ impl DeployCommand { // via only `add_revision` if bindle naming schema is updated so bindles can be deterministically ordered by Cloud. let channel_id = match self.get_app_id_cloud(&client, name.clone()).await { Ok(app_id) => { - Client::add_revision( - &client, - name.clone(), - bindle_id.version_string().clone(), - ) - .await?; + Client::add_revision(&client, name.clone(), bindle_id.version_string().clone()) + .await?; let existing_channel_id = self .get_channel_id_cloud(&client, SPIN_DEPLOY_CHANNEL_NAME.to_string(), app_id) .await?; @@ -197,7 +193,7 @@ impl DeployCommand { None, Some(active_revision_id), None, - None + None, ) .await .context("Problem patching a channel")?; @@ -587,7 +583,10 @@ pub async fn login_connection(deployment_env_id: Option<&str>) -> Result { // TODO: allow auto redirect to login preserving the name eprintln!("You have no instance saved as '{}'", name); - eprintln!("Run `spin platform login --environment-name {}` to log in", name); + eprintln!( + "Run `spin platform login --environment-name {}` to log in", + name + ); std::process::exit(1); } None => { diff --git a/src/commands/login.rs b/src/commands/login.rs index 932b80f..f7f916f 100644 --- a/src/commands/login.rs +++ b/src/commands/login.rs @@ -1,5 +1,5 @@ -use std::io::Write; use std::io::stdin; +use std::io::Write; use std::path::PathBuf; use anyhow::{bail, Context, Result}; @@ -10,10 +10,10 @@ use serde::Serialize; use tracing::log; use url::Url; - use crate::opts::{ - PLATFORM_SERVER_URL_OPT, PLATFORM_URL_ENV, DEPLOYMENT_ENV_NAME_ENV, INSECURE_OPT, SPIN_AUTH_TOKEN, HIPPO_USERNAME, HIPPO_PASSWORD, BINDLE_SERVER_URL_OPT, BINDLE_URL_ENV, BINDLE_USERNAME, BINDLE_PASSWORD, - TOKEN, + BINDLE_PASSWORD, BINDLE_SERVER_URL_OPT, BINDLE_URL_ENV, BINDLE_USERNAME, + DEPLOYMENT_ENV_NAME_ENV, HIPPO_PASSWORD, HIPPO_USERNAME, INSECURE_OPT, PLATFORM_SERVER_URL_OPT, + PLATFORM_URL_ENV, SPIN_AUTH_TOKEN, TOKEN, }; const DEFAULT_PLATFORM_URL: &str = "https://127.0.0.1:5309/"; @@ -115,7 +115,7 @@ pub struct LoginCommand { name = "list", long = "list", takes_value = false, - conflicts_with = "environment-name", + conflicts_with = "environment-name" )] pub list: bool, } @@ -136,8 +136,7 @@ fn parse_url(url: &str) -> Result { impl LoginCommand { pub async fn run(&self) -> Result<()> { - if self.list - { + if self.list { self.run_list().await? }