Split header spec into smaller functions

This commit is contained in:
Matthias Beyer 2015-10-31 12:13:21 +01:00
parent b76d38f4c6
commit 8cffdddab2

View file

@ -1,15 +1,18 @@
use storage::file::FileHeaderSpec as FHS;
pub fn get_spec() -> FHS {
FHS::Map {
keys: vec![
FHS::Key { name: "URL", value_type: Box::new(FHS::Text) },
FHS::Key { name: "TAGS",
value_type: Box::new(FHS::Array {
allowed_types: vec![FHS::Text]
}),
},
],
}
FHS::Map { keys: vec![ url_key(), tags_key() ] }
}
fn url_key() -> FHS {
FHS::Key { name: "URL", value_type: Box::new(FHS::Text) }
}
fn tags_key() -> FHS {
FHS::Key { name: "TAGS", value_type: Box::new(text_array()) }
}
fn text_array() -> FHS {
FHS::Array { allowed_types: vec![FHS::Text] }
}