Skip to content

Commit

Permalink
version: bump to 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vanilla-extracts committed Feb 14, 2025
1 parent 992c6c0 commit fb00a84
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mini-calc"
version = "3.4.2-alpha"
version = "3.4.2"
license = "GPL-3.0-or-later"
description = "A Fully-Featured Configurable (mini) Rust Calculator"
homepage = "https://calc.charlotte-thomas.me"
Expand Down
4 changes: 2 additions & 2 deletions src/configuration/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ansi_term::{ANSIGenericString, Color};
use confy::ConfyError;
use serde::{Deserialize, Serialize};

use crate::exact_math::float_mode::FloatMode;
use crate::{exact_math::float_mode::FloatMode, VERSION};

#[derive(Clone, Serialize, Deserialize)]
pub struct Greeting {
Expand Down Expand Up @@ -149,7 +149,7 @@ fn load_float_mode(dfm: String) -> FloatMode {

pub fn replace_variable(str: String) -> String {
str.replace("%author%", "Charlotte Thomas")
.replace("%version%", "v3.4.2-alpha")
.replace("%version%", VERSION)
.to_string()
}

Expand Down
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ mod parsing;
mod utils;

thread_local! {static FLOAT_MODE: RefCell<FloatMode> = const {RefCell::new(FloatMode::Exact)}}
static VERSION: &str = "v3.4.2";

fn show_config(config: Config) -> (String, Option<Config>) {
let loaded = load_config(config.clone());
Expand Down Expand Up @@ -285,7 +286,6 @@ fn handle_config(line: &str, config: Config) -> (String, Option<Config>) {
fn main() {
let mut args: Args = env::args();

let version: String = "v3.4.2-alpha".to_string();
if args.len() > 1 || !atty::is(Stream::Stdin) {
let mut a = vec![];

Expand All @@ -312,8 +312,8 @@ fn main() {
exit(0);
}

if arg_final == "-v" || arg_final == "--version" {
println!("Calc {version}");
if arg_final == "-v" || arg_final == "--VERSION" {
println!("Calc {VERSION}");
exit(0);
}

Expand All @@ -330,7 +330,7 @@ fn main() {
.output()
.expect("update failed")
};
println!("mini-calc has been succesfully updated to the latest version");
println!("mini-calc has been succesfully updated to the latest VERSION");
exit(0);
}

Expand Down Expand Up @@ -395,18 +395,18 @@ fn main() {
while let ReadResult::Input(line) = interface.read_line().unwrap() {
match line.as_str().trim() {
"info" => {
let message = loaded.general_color.paint(format!(" Calc {version} \n Author: Charlotte Thomas \n Written in Rust \n Repo: https://github.com/vanilla-extracts/calc\n"));
let message = loaded.general_color.paint(format!(" Calc {VERSION} \n Author: Charlotte Thomas \n Written in Rust \n Repo: https://github.com/vanilla-extracts/calc\n"));
println!("{}", message)
}
"exit" => break,
"help" => {
let message = loaded.general_color.paint(format!(
" Calc {version} Help \n > info : show infos \n > exit : exit the program \n > help : print this help \n > verbose : toggle the verbose \n > version : prints the version \n > config : root of the config \n toggle_float <exact|science|normal> : toggle the float mode"
" Calc {VERSION} Help \n > info : show infos \n > exit : exit the program \n > help : print this help \n > verbose : toggle the verbose \n > version : prints the version \n > config : root of the config \n toggle_float <exact|science|normal> : toggle the float mode"
));
println!("{}", message)
}
"version" => {
let message = loaded.general_color.paint(format!(" Calc {version}\n"));
"VERSION" => {
let message = loaded.general_color.paint(format!(" Calc {VERSION}\n"));
println!("{}", message)
}
"verbose" => {
Expand Down

0 comments on commit fb00a84

Please sign in to comment.