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