diff --git a/crates/idfoto-core/src/settings.rs b/crates/idfoto-core/src/settings.rs index 7557252..ccc8c96 100644 --- a/crates/idfoto-core/src/settings.rs +++ b/crates/idfoto-core/src/settings.rs @@ -95,7 +95,7 @@ pub struct CharClasses { } #[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(tag = "kind", rename_all = "snake_case")] +#[serde(tag = "kind", content = "value", rename_all = "snake_case")] pub enum SymbolCharset { SafeOnly, Extended, @@ -170,4 +170,15 @@ mod tests { _ => panic!("expected Random default"), } } + + #[test] + fn symbol_charset_custom_round_trips() { + let c = SymbolCharset::Custom("!@#".into()); + let json = serde_json::to_string(&c).unwrap(); + let parsed: SymbolCharset = serde_json::from_str(&json).unwrap(); + match parsed { + SymbolCharset::Custom(s) => assert_eq!(s, "!@#"), + other => panic!("expected Custom, got {:?}", other), + } + } }