Extract `labels` (array of strings) from frontmatter JSON.
(frontmatter_json: &str)
| 724 | |
| 725 | /// Extract `labels` (array of strings) from frontmatter JSON. |
| 726 | fn frontmatter_labels(frontmatter_json: &str) -> Vec<String> { |
| 727 | serde_json::from_str::<serde_json::Value>(frontmatter_json) |
| 728 | .ok() |
| 729 | .and_then(|v| { |
| 730 | v.get("labels").and_then(|l| l.as_array()).map(|arr| { |
| 731 | arr.iter() |
| 732 | .filter_map(|x| x.as_str().map(String::from)) |
| 733 | .collect() |
| 734 | }) |
| 735 | }) |
| 736 | .unwrap_or_default() |
| 737 | } |
| 738 | |
| 739 | fn is_eligible_memory(entry: &VaultEntry) -> bool { |
| 740 | if entry.entry_type != VaultEntryType::Memory { |