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_Handler.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_handler.rs`, see https://github.com/diwic/dbus-rs
|
||||
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Handler.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_handler.rs`, see https://github.com/diwic/dbus-rs
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -23,8 +23,8 @@ pub fn channel_handler_server<F, T, D>(
|
||||
where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
T: ChannelHandler,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelHandler>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.ChannelHandler", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -37,7 +37,8 @@ where
|
||||
let channel: dbus::Path = i.read()?;
|
||||
let handle_type: u32 = i.read()?;
|
||||
let handle: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.handle_channel(
|
||||
bus_name,
|
||||
connection,
|
||||
|
Reference in New Issue
Block a user