summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-08-08 12:38:51 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-08-08 12:38:51 +0200
commit206c6a9349b5141cb3e2fc692a61732d7674afc7 (patch)
treebe389dacd020f4cb750d1f3745c6d1d7752d4631
parent29cfaf8f319ce6ce6b4cd818e7bb730c8c18a3b1 (diff)
Populate cache with extension
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/helpers/highlight.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helpers/highlight.rs b/src/helpers/highlight.rs
index f6ca98f..e5ccd3e 100644
--- a/src/helpers/highlight.rs
+++ b/src/helpers/highlight.rs
@@ -7,9 +7,9 @@ use syntect::html::highlighted_html_for_string;
use syntect::parsing::SyntaxSet;
#[cached(
- type = "SizedCache<String, Return<String>>",
+ type = "SizedCache<(String, String), Return<String>>",
create = "{ SizedCache::with_size(100) }",
- convert = r#"{ s.to_string() }"#,
+ convert = r#"{ (String::from(ext.unwrap_or("")), s.to_string()) }"#,
with_cached_flag = true,
result = true,