Split header spec into smaller functions
This commit is contained in:
parent
b76d38f4c6
commit
8cffdddab2
1 changed files with 13 additions and 10 deletions
|
@ -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] }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue