From 78fce24d312e6fef2492f4d89fa4af01eae6f83c Mon Sep 17 00:00:00 2001 From: Milo <50248166+Milo123459@users.noreply.github.com> Date: Sun, 24 Sep 2023 10:24:39 +0000 Subject: [PATCH] little bit of cleaning up --- src/commands/down.rs | 6 +----- src/commands/logs.rs | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/commands/down.rs b/src/commands/down.rs index d0f767567..5af1eaa8b 100644 --- a/src/commands/down.rs +++ b/src/commands/down.rs @@ -93,11 +93,7 @@ pub async fn command(args: Args, _json: bool) -> Result<()> { .edges .into_iter() .filter_map(|deployment| { - if deployment.node.status == DeploymentStatus::SUCCESS { - Some(deployment.node) - } else { - None - } + (deployment.node.status == DeploymentStatus::SUCCESS).then_some(deployment.node) }) .collect(); deployments.sort_by(|a, b| b.created_at.cmp(&a.created_at)); diff --git a/src/commands/logs.rs b/src/commands/logs.rs index 8e490f219..587e4a336 100644 --- a/src/commands/logs.rs +++ b/src/commands/logs.rs @@ -81,11 +81,7 @@ pub async fn command(args: Args, json: bool) -> Result<()> { .edges .into_iter() .filter_map(|deployment| { - if deployment.node.status == DeploymentStatus::SUCCESS { - Some(deployment.node) - } else { - None - } + (deployment.node.status == DeploymentStatus::SUCCESS).then_some(deployment.node) }) .collect(); deployments.sort_by(|a, b| b.created_at.cmp(&a.created_at));