Skip to content

Commit

Permalink
Revert Rust edition
Browse files Browse the repository at this point in the history
  • Loading branch information
theodore-s-beers committed Dec 13, 2024
1 parent ef7af49 commit 9b76d1e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "gloss-word"
version = "0.3.0"
authors = ["Theo Beers <[email protected]>"]
edition = "2024"
edition = "2021"
categories = ["command-line-utilities"]
description = "A simple English dictionary lookup utility"
homepage = "https://github.com/theodore-s-beers/gloss-word"
Expand Down
36 changes: 18 additions & 18 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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(())
Expand Down

0 comments on commit 9b76d1e

Please sign in to comment.