Fails to serialize a struct with HashMap
The following is bugging the serializer:
#[test]
fn struct_with_hashmap_of_value() {
use crate as zvariant;
use serde::Serialize;
let mut hm = HashMap::new();
hm.insert("key".into(), Value::from(55));
#[derive(Type, Serialize)]
struct Foo {
hmap: HashMap<String, Value<'static>>,
}
let foo = Foo { hmap: hm };
let ctxt = Context::<LE>::new_dbus(0);
to_bytes(ctxt, &foo).unwrap();
}
thread 'tests::struct_with_hashmap_of_value' panicked at 'called
Result::unwrap()on an
Errvalue: Message("invalid type: character
a, expected
s,
g,
oor
v")', zvariant/src/lib.rs:738:9
When the struct has another field inside, the error is bit different. That might be another related issue.
Edited by Marc-André Lureau