Extract `labels` (array of strings) from frontmatter JSON.
(frontmatter_json: &str)
| 704 | |
| 705 | /// Extract `labels` (array of strings) from frontmatter JSON. |
| 706 | fn frontmatter_labels(frontmatter_json: &str) -> Vec<String> { |
| 707 | serde_json::from_str::<serde_json::Value>(frontmatter_json) |
| 708 | .ok() |
| 709 | .and_then(|v| { |
| 710 | v.get("labels").and_then(|l| l.as_array()).map(|arr| { |
| 711 | arr.iter() |
| 712 | .filter_map(|x| x.as_str().map(String::from)) |
| 713 | .collect() |
| 714 | }) |
| 715 | }) |
| 716 | .unwrap_or_default() |
| 717 | } |
| 718 | |
| 719 | fn is_eligible_memory(entry: &VaultEntry) -> bool { |
| 720 | if entry.entry_type != VaultEntryType::Memory { |
no test coverage detected