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/Channel_Interface_Transfer.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_transfer.rs`, see https://github.com/diwic/dbus-rs
|
||||
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Transfer.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_transfer.rs`, see https://github.com/diwic/dbus-rs
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -15,8 +15,8 @@ pub fn channel_interface_transfer_server<F, T, D>(
|
||||
where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
T: ChannelInterfaceTransfer,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceTransfer>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Transfer", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -25,7 +25,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let member: u32 = i.read()?;
|
||||
let destination: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.transfer(member, destination)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
|
Reference in New Issue
Block a user