From e19818283e337071e33eb44f3405a26996502685 Mon Sep 17 00:00:00 2001 From: Alexander Ng Date: Wed, 12 Feb 2025 02:10:02 -0800 Subject: [PATCH] fmt --- src/commands/get/projects.rs | 15 +++++++++++++-- src/sdk.rs | 7 +++++-- src/utils/choice.rs | 11 +++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/commands/get/projects.rs b/src/commands/get/projects.rs index 35a0ed9..0c9100a 100644 --- a/src/commands/get/projects.rs +++ b/src/commands/get/projects.rs @@ -18,8 +18,19 @@ pub async fn command(args: Args) -> Result<()> { .context("Failed to get projects from server".red())?; let remote_projects = remote_projects .iter() - .filter(|p| !local_projects.iter().any(|lp| lp.project_id == p.project_id)) - .map(|p| format!("{} - {} - {}", p.project_id, p.project_name, "Remote".green())); + .filter(|p| { + !local_projects + .iter() + .any(|lp| lp.project_id == p.project_id) + }) + .map(|p| { + format!( + "{} - {} - {}", + p.project_id, + p.project_name, + "Remote".green() + ) + }); let local_projects = local_projects .iter() diff --git a/src/sdk.rs b/src/sdk.rs index 7f36f38..66108a2 100644 --- a/src/sdk.rs +++ b/src/sdk.rs @@ -1,7 +1,7 @@ use super::*; use crate::{ - types::ProjectInfo, types::ListProjects, + types::ProjectInfo, utils::{ auth::get_token, config::get_config, @@ -465,7 +465,10 @@ impl SDK { Ok(project_data) } - pub async fn new_project(partial_fingerprint: &str, project_name: &str) -> Result { + pub async fn new_project( + partial_fingerprint: &str, + project_name: &str, + ) -> Result { // POST /v2/projects/new let client = reqwest::Client::new(); diff --git a/src/utils/choice.rs b/src/utils/choice.rs index 93313e5..958bf88 100644 --- a/src/utils/choice.rs +++ b/src/utils/choice.rs @@ -22,7 +22,11 @@ impl Choice { let all_projects = all_projects .iter() - .filter(|p| !local_projects.iter().any(|lp| lp.project_id == p.project_id)) + .filter(|p| { + !local_projects + .iter() + .any(|lp| lp.project_id == p.project_id) + }) .collect::>(); let mut options = local_projects @@ -31,7 +35,10 @@ impl Choice { .collect::>(); all_projects.iter().for_each(|p| { - options.push(format!("{} - {} - {}", p.project_id, p.project_name, "Remote")); + options.push(format!( + "{} - {} - {}", + p.project_id, p.project_name, "Remote" + )); }); let selected =