Use AsRefClosure when generating the bindings
This simplifies things significantly \o/
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Connection_Interface_Contact_Capabilities.xml -i org.freedesktop.Telepathy -o src/telepathy/connection_interface_contact_capabilities.rs`, see https://github.com/diwic/dbus-rs
|
||||
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Connection_Interface_Contact_Capabilities.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/connection_interface_contact_capabilities.rs`, see https://github.com/diwic/dbus-rs
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -36,8 +36,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Signal: Default,
|
||||
T: ConnectionInterfaceContactCapabilities,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ConnectionInterfaceContactCapabilities>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities",
|
||||
@@ -52,7 +52,8 @@ where
|
||||
Vec<::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>>,
|
||||
Vec<&str>,
|
||||
)> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.update_capabilities(handler_capabilities)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -65,7 +66,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let handles: Vec<u32> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let contact_capabilities = d.get_contact_capabilities(handles)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(contact_capabilities);
|
||||
|
Reference in New Issue
Block a user