chore: clippy + fmt

This commit is contained in:
Edward Langley
2026-04-01 22:17:11 -07:00
parent 1d5edd2c09
commit b9818204a4
5 changed files with 12 additions and 10 deletions

View File

@ -175,7 +175,9 @@ fn import_headless(
model_name: Option<&str>,
array_path: Option<&str>,
) -> CommandResult {
let is_csv = path.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("csv"));
let is_csv = path
.extension()
.is_some_and(|ext| ext.eq_ignore_ascii_case("csv"));
let records = if is_csv {
// Parse CSV file

View File

@ -26,7 +26,6 @@ use crate::ui::import_wizard_ui::ImportWizardWidget;
use crate::ui::tile_bar::TileBar;
use crate::ui::view_panel::ViewPanel;
struct TuiContext<'a> {
terminal: Terminal<CrosstermBackend<&'a mut Stdout>>,
}

View File

@ -16,7 +16,7 @@ pub fn parse_formula(raw: &str, target_category: &str) -> Result<Formula> {
// Check for WHERE clause at top level
let (expr_str, filter) = split_where(rest);
let filter = filter.map(|w| parse_where(w)).transpose()?;
let filter = filter.map(parse_where).transpose()?;
let expr = parse_expr(expr_str.trim())?;
@ -299,7 +299,7 @@ fn parse_primary(tokens: &[Token], pos: &mut usize) -> Result<Expr> {
// Optional WHERE filter
let filter = if *pos < tokens.len() {
if let Token::Ident(kw) = &tokens[*pos] {
if kw.to_ascii_uppercase() == "WHERE" {
if kw.eq_ignore_ascii_case("WHERE") {
*pos += 1;
let cat = match &tokens[*pos] {
Token::Ident(s) => {

View File

@ -1,18 +1,18 @@
mod command;
mod draw;
mod formula;
mod import;
mod model;
mod persistence;
mod ui;
mod view;
mod draw;
use std::path::PathBuf;
use anyhow::{Context, Result};
use model::Model;
use draw::run_tui;
use model::Model;
use serde_json::Value;
fn main() -> Result<()> {
@ -42,8 +42,9 @@ impl Runnable for CmdLineArgs {
}
}
fn csv_path_p(path:&PathBuf) -> bool {
path.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("csv"))
fn csv_path_p(path: &PathBuf) -> bool {
path.extension()
.is_some_and(|ext| ext.eq_ignore_ascii_case("csv"))
}
fn get_import_data(path: PathBuf) -> Option<Value> {
@ -115,7 +116,7 @@ impl Runnable for HeadlessArgs {
}
if let Some(path) = self.file_path {
persistence::save(&mut model, &path)?;
persistence::save(&model, &path)?;
}
std::process::exit(exit_code);

View File

@ -223,7 +223,7 @@ fn expand_category(
}
// Skip the data item if its group is collapsed.
if item_group.map_or(false, |g| view.is_group_collapsed(cat_name, g)) {
if item_group.is_some_and(|g| view.is_group_collapsed(cat_name, g)) {
continue;
}