Improved ergonomics of API accepting ObjectPath as a generic type
Currently the generic type for anything that can be converted into an ObjectPath
would be impl TryInto<ObjectPath, Error=zvariant::Error>
, which has two issues:
- It (ironically) won't work for
ObjectPath
itself becauseTryInto<T> for T
is not possible as that contradicts the blanketimpl Into<T> for T
. - Having to explicitly specify the error is super annoying.
So we introduce a new trait, IntoObjectPath
(and IntoOwnedObjectPath
) that has a specific error type and we implement it for ObjectPath
itself as well.
Fixes #139 (closed).
This branch is based on !261 (merged).