Extract `labels` (array of strings) from frontmatter JSON.
(frontmatter_json: &str)
| 287 | |
| 288 | /// Extract `labels` (array of strings) from frontmatter JSON. |
| 289 | fn frontmatter_labels(frontmatter_json: &str) -> Vec<String> { |
| 290 | serde_json::from_str::<serde_json::Value>(frontmatter_json) |
| 291 | .ok() |
| 292 | .and_then(|v| { |
| 293 | v.get("labels").and_then(|l| l.as_array()).map(|arr| { |
| 294 | arr.iter() |
| 295 | .filter_map(|x| x.as_str().map(String::from)) |
| 296 | .collect() |
| 297 | }) |
| 298 | }) |
| 299 | .unwrap_or_default() |
| 300 | } |
| 301 | |
| 302 | fn is_eligible_memory(entry: &VaultEntry) -> bool { |
| 303 | if entry.entry_type != VaultEntryType::Memory { |