summaryrefslogtreecommitdiffstats
path: root/src/utils.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-09 15:30:39 +0800
committerGitHub <noreply@github.com>2023-03-09 15:30:39 +0800
commit05d20f207fedf03c2a564438a0d44a2d85d4ed2d (patch)
treeeb7c9ae402632c5827cd4faa323b138510716f22 /src/utils.rs
parentc7eb261abc32ac4d6fc5364244a6246bcdc462d9 (diff)
downloadaichat-05d20f207fedf03c2a564438a0d44a2d85d4ed2d.tar.gz
feat: add remain tokens indicator and max tokens guard (#50)
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/utils.rs b/src/utils.rs
deleted file mode 100644
index 2c61f1c..0000000
--- a/src/utils.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-use chrono::prelude::*;
-use crossterm::style::{Color, Stylize};
-use std::io::{stdout, Write};
-
-#[macro_export]
-macro_rules! print_now {
- ($($arg:tt)*) => {
- $crate::utils::print_now(&format!($($arg)*))
- };
-}
-
-pub fn print_now<T: ToString>(text: T) {
- print!("{}", text.to_string());
- let _ = stdout().flush();
-}
-
-pub fn now() -> String {
- let now = Local::now();
- now.to_rfc3339_opts(SecondsFormat::Secs, false)
-}
-
-pub fn emphasis(text: &str) -> String {
- text.stylize().with(Color::White).to_string()
-}