From 70118d77391fb9403f672776958d3217481b6089 Mon Sep 17 00:00:00 2001 From: Anthony Griffon Date: Wed, 29 Nov 2023 21:47:43 +0100 Subject: [PATCH] misc: fix stable release Signed-off-by: Anthony Griffon --- cli/src/application/create/mod.rs | 2 +- cli/src/main.rs | 2 -- cli/src/package/http_auth_server/mod.rs | 6 +++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cli/src/application/create/mod.rs b/cli/src/application/create/mod.rs index 1ded680..ed4a80f 100644 --- a/cli/src/application/create/mod.rs +++ b/cli/src/application/create/mod.rs @@ -46,7 +46,7 @@ impl SwarmdCommand for CreateArg { let mut base = std::env::current_dir().context("Couldn't read current directory")?; base.push(&self.name); - if let Ok(true) = std::fs::try_exists(&base) { + if std::fs::metadata(&base).is_ok() { bail!("A file or folder already exist at the given path."); } diff --git a/cli/src/main.rs b/cli/src/main.rs index 98838d7..a5eb946 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,5 +1,3 @@ -#![feature(fs_try_exists)] - mod application; mod domain; mod infrastructure; diff --git a/cli/src/package/http_auth_server/mod.rs b/cli/src/package/http_auth_server/mod.rs index 30a0778..4a8f13b 100644 --- a/cli/src/package/http_auth_server/mod.rs +++ b/cli/src/package/http_auth_server/mod.rs @@ -88,9 +88,9 @@ async fn token<'a>( info!("Token received."); let token = &query.token; - let _ = state.token_tx.try_send(token.clone()).inspect_err(|err| { + if let Err(err) = state.token_tx.try_send(token.clone()) { tracing::error!("{err:?}"); - }); + } - Redirect::temporary(&format!("{AUTH_URL}")) + Redirect::temporary(AUTH_URL) }