summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-07-17 12:30:35 +0800
committerGitHub <noreply@github.com>2024-07-17 12:30:35 +0800
commite81b215696b8941acbe47a449c19f6967133e551 (patch)
tree22f4796a09c41b26426bb132c634c6a89cb7668b /src/utils
parent24347a8a6634b18d3a7dbf7afb0df54fb4311826 (diff)
downloadaichat-e81b215696b8941acbe47a449c19f6967133e551.tar.gz
refactor: config creation prompt aware of env var (#722)
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index aa63f3b..340359c 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -36,11 +36,7 @@ pub fn now() -> String {
}
pub fn get_env_name(key: &str) -> String {
- format!(
- "{}_{}",
- env!("CARGO_CRATE_NAME").to_uppercase(),
- key.to_uppercase(),
- )
+ format!("{}_{key}", env!("CARGO_CRATE_NAME"),).to_ascii_uppercase()
}
pub fn estimate_token_length(text: &str) -> usize {