We should really use String here

This commit is contained in:
Matthias Beyer 2015-11-10 16:53:30 +01:00
parent cd72295c1a
commit 51f6af6346
2 changed files with 6 additions and 6 deletions

View File

@ -6,11 +6,11 @@ pub fn get_spec() -> FHS {
}
fn url_key() -> FHS {
FHS::Key { name: "URL", value_type: Box::new(FHS::Text) }
FHS::Key { name: String::from("URL"), value_type: Box::new(FHS::Text) }
}
fn tags_key() -> FHS {
FHS::Key { name: "TAGS", value_type: Box::new(text_array()) }
FHS::Key { name: String::from("TAGS"), value_type: Box::new(text_array()) }
}
fn text_array() -> FHS {
@ -22,11 +22,11 @@ pub fn build_header(url: &String, tags: &Vec<String>) -> FHD {
FHD::Map {
keys: vec![
FHD::Key {
name: "URL",
name: String::from("URL"),
value: Box::new(FHD::Text(url.clone()))
},
FHD::Key {
name: "TAGS",
name: String::from("TAGS"),
value: Box::new(FHD::Text(tags.connect(",")))
}
]

View File

@ -16,7 +16,7 @@ pub enum FileHeaderSpec {
UInteger,
Float,
Text,
Key { name: &'static str, value_type: Box<FileHeaderSpec> },
Key { name: String, value_type: Box<FileHeaderSpec> },
Map { keys: Vec<FileHeaderSpec> },
Array { allowed_types: Vec<FileHeaderSpec> },
}
@ -30,7 +30,7 @@ pub enum FileHeaderData {
UInteger(u64),
Float(f64),
Text(String),
Key { name: &'static str, value: Box<FileHeaderData> },
Key { name: String, value: Box<FileHeaderData> },
Map { keys: Vec<FileHeaderData> },
Array { values: Box<Vec<FileHeaderData>> },
}