#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct UserArtifact {
pub done: Option<String>,
pub partof: Option<UserPartof>,
pub text: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UserPartof {
Single(String),
Multi(Vec<String>),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct RawSettings {
pub artifact_paths: Option<Vec<String>>,
pub exclude_artifact_paths: Option<Vec<String>>,
pub code_paths: Option<Vec<String>>,
pub exclude_code_paths: Option<Vec<String>>,
}
#[test]
fn test_toml_simple() {
use toml;
use std::collections::BTreeMap;
let raw = r#"[bar]
partof = [
'foo',
'bar',
]
[foo]
partof = 'bar'
"#;
let value: BTreeMap<String, UserArtifact> = toml::from_str(raw).unwrap();
assert_eq!(raw, toml::to_string_pretty(&value).unwrap());
}