aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-18 04:10:00 -0700
committerFuwn <[email protected]>2022-04-18 04:10:00 -0700
commit7878dffa113e8051bdb229b04d33bcca74f21a7e (patch)
treeb322596a1ee621defe1cb83aee61c64c3fbad971 /src
parentfeat: show preview for searches (diff)
downloadlocus-7878dffa113e8051bdb229b04d33bcca74f21a7e.tar.xz
locus-7878dffa113e8051bdb229b04d33bcca74f21a7e.zip
feat: cache more dynamic routes
Diffstat (limited to 'src')
-rw-r--r--src/macros.rs6
-rw-r--r--src/main.rs2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/macros.rs b/src/macros.rs
index f0e805f..bfaf9c2 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -18,7 +18,9 @@
#[macro_export]
macro_rules! success {
- ($body:expr, $context:ident) => {
+ ($body:expr, $context:ident) => {{
+ $crate::route::cache(&$context, &$body);
+
Response::Success(
Main {
body: &$body,
@@ -37,7 +39,7 @@ macro_rules! success {
}
.to_string(),
)
- };
+ }};
}
#[macro_export]
diff --git a/src/main.rs b/src/main.rs
index 43b8448..d529f5c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -287,7 +287,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
format!(
"# REMARKS\n\n{}",
remarks
- .into_iter()
+ .iter()
.map(|r| format!("* {}", r))
.collect::<Vec<String>>()
.join("\n")