From 9b76d1e6c9ea002ce7e28707bc4cc523fd71e5c9 Mon Sep 17 00:00:00 2001 From: Theo Beers Date: Fri, 13 Dec 2024 11:20:59 -0500 Subject: [PATCH] Revert Rust edition --- Cargo.toml | 2 +- src/main.rs | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 28cbd38..33a16c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "gloss-word" version = "0.3.0" authors = ["Theo Beers "] -edition = "2024" +edition = "2021" categories = ["command-line-utilities"] description = "A simple English dictionary lookup utility" homepage = "https://github.com/theodore-s-beers/gloss-word" diff --git a/src/main.rs b/src/main.rs index b990901..a99c09c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,8 +6,8 @@ use std::path::PathBuf; use std::process::Command; use std::{fs, str}; -use anyhow::{Context, anyhow}; -use clap::{Arg, ArgAction, command}; +use anyhow::{anyhow, Context}; +use clap::{command, Arg, ArgAction}; use directories::ProjectDirs; use gloss_word::{compile_results, get_response_text, get_section_vec, pandoc_primary, take_chunk}; use indicatif::{ProgressBar, ProgressStyle}; @@ -304,27 +304,27 @@ fn update_cache( // If we have force-fetch flag and got a cache hit, update if force_fetch && cache_hit { if etym_mode { - db_conn.execute("UPDATE etymology SET content = (?1) WHERE word = (?2)", [ - final_output, - desired_word, - ])?; + db_conn.execute( + "UPDATE etymology SET content = (?1) WHERE word = (?2)", + [final_output, desired_word], + )?; } else { - db_conn.execute("UPDATE dictionary SET content = (?1) WHERE word = (?2)", [ - final_output, - desired_word, - ])?; + db_conn.execute( + "UPDATE dictionary SET content = (?1) WHERE word = (?2)", + [final_output, desired_word], + )?; } // Else insert } else if etym_mode { - db_conn.execute("INSERT INTO etymology (word, content) VALUES (?1, ?2)", [ - desired_word, - final_output, - ])?; + db_conn.execute( + "INSERT INTO etymology (word, content) VALUES (?1, ?2)", + [desired_word, final_output], + )?; } else { - db_conn.execute("INSERT INTO dictionary (word, content) VALUES (?1, ?2)", [ - desired_word, - final_output, - ])?; + db_conn.execute( + "INSERT INTO dictionary (word, content) VALUES (?1, ?2)", + [desired_word, final_output], + )?; } Ok(())