Extract `labels` (array of strings) from frontmatter JSON.
(frontmatter_json: &str)
| 654 | |
| 655 | /// Extract `labels` (array of strings) from frontmatter JSON. |
| 656 | fn frontmatter_labels(frontmatter_json: &str) -> Vec<String> { |
| 657 | serde_json::from_str::<serde_json::Value>(frontmatter_json) |
| 658 | .ok() |
| 659 | .and_then(|v| { |
| 660 | v.get("labels").and_then(|l| l.as_array()).map(|arr| { |
| 661 | arr.iter() |
| 662 | .filter_map(|x| x.as_str().map(String::from)) |
| 663 | .collect() |
| 664 | }) |
| 665 | }) |
| 666 | .unwrap_or_default() |
| 667 | } |
| 668 | |
| 669 | fn is_eligible_memory(entry: &VaultEntry) -> bool { |
| 670 | if entry.entry_type != VaultEntryType::Memory { |
no test coverage detected