Replace FromValue/IntoValue with TryFrom/Into
FromValue
is a custom zvariant trait that isn't really convenient for Rust users. It does what TryFrom
is supposed to do, plus it downcasts~~~~unwraps. Instead, implement the idiomatic TryFrom
for the various Value kind, and use Value::downcast_ref()
when an explicit unwrap is expected. Similarly, for IntoValue
, implement From
for the various types, and add a Value::new()
method for the case where you expect Value->Value(Value)
Edited by Marc-André Lureau