BM header helpers: Add get_url_from_header()
This commit is contained in:
parent
2e7621d2bd
commit
7170f95825
2 changed files with 13 additions and 1 deletions
|
@ -30,3 +30,7 @@ pub fn get_tags_from_header(header: &FHD) -> Vec<String> {
|
|||
headerhelpers::tags::data::get_tags_from_header(header)
|
||||
}
|
||||
|
||||
pub fn get_url_from_header(header: &FHD) -> Option<String> {
|
||||
headerhelpers::data::get_url_from_header(header)
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,15 @@ pub mod data {
|
|||
}
|
||||
}).and_then(|urlkey| {
|
||||
match urlkey.deref().clone() {
|
||||
FHD::Text(s) => Some(s),
|
||||
FHD::Key{name: _, value: ref v} => {
|
||||
match v.deref().clone() {
|
||||
FHD::Text(s) => Some(s),
|
||||
_ => {
|
||||
warn!("Malformed Header Data: Expected Text, found non-Text");
|
||||
None
|
||||
},
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
warn!("Malformed Header Data: Expected Text, found non-Text");
|
||||
None
|
||||
|
|
Loading…
Reference in a new issue