summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mem_mgr.rs33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/mem_mgr.rs b/src/mem_mgr.rs
index c6e442e..0709866 100644
--- a/src/mem_mgr.rs
+++ b/src/mem_mgr.rs
@@ -91,6 +91,8 @@ pub fn phantom_render_result_forgotten(_p: ResultForgotten) {}
#[derive(Serialize, Groupped)]
pub struct ResultDumpAll {
+ #[serde(rename = "IMPORTANT")]
+ pub important: Vec<ImportantEntry>,
pub entries: Vec<DumpEntry>,
}
@@ -100,6 +102,12 @@ pub struct DumpEntry {
pub content: String,
}
+#[derive(Serialize)]
+pub struct ImportantEntry {
+ pub title: String,
+ pub reason: String,
+}
+
#[renderer]
pub fn phantom_render_result_dumpall(_p: ResultDumpAll) {}
@@ -248,7 +256,30 @@ fn dumpall(constants: &Constants, about: String) -> ResultDumpAll {
}
}
}
- ResultDumpAll { entries }
+
+ // Scan for IMPORTANT entries
+ let important: Vec<ImportantEntry> = entries
+ .iter()
+ .filter_map(|entry| {
+ let title_upper = entry.title.to_uppercase();
+ let content_upper = entry.content.to_uppercase();
+ if title_upper.contains("IMPORTANT") {
+ Some(ImportantEntry {
+ title: entry.title.clone(),
+ reason: "title contains IMPORTANT".to_string(),
+ })
+ } else if content_upper.contains("IMPORTANT") {
+ Some(ImportantEntry {
+ title: entry.title.clone(),
+ reason: "content contains IMPORTANT".to_string(),
+ })
+ } else {
+ None
+ }
+ })
+ .collect();
+
+ ResultDumpAll { entries, important }
}
fn item_path(constants: &Constants, title: &String) -> PathBuf {