aboutsummaryrefslogtreecommitdiff
path: root/src/modules/stocks.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-04-16 21:15:12 -0700
committerFuwn <[email protected]>2023-04-16 21:15:12 -0700
commitc7adc5f014d4635c8468a863a124ddce4a9fe0e7 (patch)
tree2f5a8aafdbf3fa0712d01ecb95ccd10eb691fd10 /src/modules/stocks.rs
parentfix(amenadiel): modules macro unwrap on none (diff)
downloadlocus-c7adc5f014d4635c8468a863a124ddce4a9fe0e7.tar.xz
locus-c7adc5f014d4635c8468a863a124ddce4a9fe0e7.zip
refactor(response): rewrite unnecessary macro to function
Diffstat (limited to 'src/modules/stocks.rs')
-rw-r--r--src/modules/stocks.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/stocks.rs b/src/modules/stocks.rs
index ff1a77d..20ab850 100644
--- a/src/modules/stocks.rs
+++ b/src/modules/stocks.rs
@@ -19,7 +19,7 @@
use once_cell::sync::Lazy;
use serde::Deserialize;
-use crate::{route::track_mount, success};
+use crate::{route::track_mount, response::success};
static REFERRALS: Lazy<Vec<Referral>> = Lazy::new(|| {
serde_json::from_str(include_str!(
@@ -112,8 +112,8 @@ pub fn module(router: &mut windmark::Router) {
"Want to start investing in the stock market? Support me by using one of \
my referral links!",
|context| {
- success!(
- format!(
+ success(
+ &format!(
"# Referrals\n\n=> /stocks Dashboard\n=> /cryptocurrency \
Cryptocurrency Dashboard\n=> /stocks/telegram Telegram Groups\n=> \
/stocks/search Search\n\nWant to start investing? Support me by \
@@ -126,7 +126,7 @@ pub fn module(router: &mut windmark::Router) {
.collect::<Vec<String>>()
.join("\n")
),
- context
+ &context
)
},
);
@@ -137,14 +137,14 @@ pub fn module(router: &mut windmark::Router) {
"Explore and search the stock market using Gemini!",
|context| {
async move {
- success!(
- format!(
+ success(
+ &format!(
"# The Stock Market\n\n=> /stocks/search Symbol Search\n=> /stocks/referrals Referrals\n=> /cryptocurrency Cryptocurrency Dashboard\n=> /stocks/telegram Telegram Groups\n\n## Popular \
Symbols\n\n### AAPL\n\n{}\n\n### TSLA\n\n{}\n\n## Credits\n\nFinancial data provided by\n\n=> https://finnhub.io/ Finnhub",
symbol_to_string("AAPL").await,
symbol_to_string("TSLA").await
),
- context
+ &context
)
}
},
@@ -190,12 +190,12 @@ pub fn module(router: &mut windmark::Router) {
}
}
- success!(
- format!(
+ success(
+ &format!(
"{}\n\n## Credits\n\nFinancial data provided by\n\n=> https://finnhub.io/ Finnhub",
response
),
- context
+ &context
)
}
},