From 591717780a1752eb5989cfd91ad371cd456b97b7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 30 Dec 2015 11:32:58 +0100 Subject: [PATCH] Notes: Add helper to get name from header --- src/module/notes/header.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/module/notes/header.rs b/src/module/notes/header.rs index 029aa698..3f27af38 100644 --- a/src/module/notes/header.rs +++ b/src/module/notes/header.rs @@ -48,3 +48,12 @@ pub fn get_tags_from_header(header: &FHD) -> Vec { headerhelpers::tags::data::get_tags_from_header(header) } +/** + * Get the name from the Header + * + * Returns empty string if there is no NAME field + */ +pub fn get_name_from_header(header: &FHD) -> String { + headerhelpers::data::get_name_from_header(header).unwrap_or(String::from("")) +} +