From c0b700f899f9d5bcf9a5b490af4e230f5dd20172 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 02:56:10 +0000 Subject: [PATCH] chore: apply rustfmt formatting --- src/core/context.rs | 4 +--- src/core/utils.rs | 15 +++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/core/context.rs b/src/core/context.rs index 6d22b9a..c39a9cc 100644 --- a/src/core/context.rs +++ b/src/core/context.rs @@ -18,9 +18,7 @@ pub fn init(quiet: bool, verbose: bool, no_color: bool, no_spinner: bool, assume ASSUME_YES.store(assume_yes, Ordering::SeqCst); let stdout_is_tty = std::io::stdout().is_terminal(); - let color_enabled = !no_color - && stdout_is_tty - && std::env::var_os("NO_COLOR").is_none(); + let color_enabled = !no_color && stdout_is_tty && std::env::var_os("NO_COLOR").is_none(); COLOR_MODE.store(color_enabled, Ordering::SeqCst); colored::control::set_override(color_enabled); diff --git a/src/core/utils.rs b/src/core/utils.rs index 71a292b..67960f1 100644 --- a/src/core/utils.rs +++ b/src/core/utils.rs @@ -1,8 +1,8 @@ +use super::context; use anyhow::{Context, Result}; use chrono::{DateTime, Utc}; use serde::Serialize; use std::io::{self, Write}; -use super::context; pub fn mask_if_empty(value: &str, fallback: &str) -> String { if value.trim().is_empty() { @@ -102,7 +102,10 @@ fn response_error(value: &serde_json::Value) -> Option { } } else if let Some(status) = value.get("status").and_then(|s| s.as_u64()) { if status >= 400 { - let title = value.get("title").and_then(|t| t.as_str()).unwrap_or("Error"); + let title = value + .get("title") + .and_then(|t| t.as_str()) + .unwrap_or("Error"); let detail = value.get("detail").and_then(|d| d.as_str()); if let Some(d) = detail { @@ -148,8 +151,8 @@ pub fn handle_json_response( } }; let data: T = serde_json::from_value(data_val.clone()).map_err(|e| { - let data_str = serde_json::to_string_pretty(data_val) - .unwrap_or_else(|_| data_val.to_string()); + let data_str = + serde_json::to_string_pretty(data_val).unwrap_or_else(|_| data_val.to_string()); anyhow::anyhow!( "failed to parse response data: {}\nData being parsed: {}", e, @@ -188,8 +191,8 @@ pub fn handle_paginated_response( let result: crate::types::base::Paginated = serde_json::from_value(value.clone()).map_err(|e| { - let data_str = serde_json::to_string_pretty(&value) - .unwrap_or_else(|_| value.to_string()); + let data_str = + serde_json::to_string_pretty(&value).unwrap_or_else(|_| value.to_string()); anyhow::anyhow!( "failed to parse response data: {}\nData being parsed: {}", e,