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/Client_Observer.xml -i org.freedesktop.Telepathy -o src/telepathy/client_observer.rs`, see https://github.com/diwic/dbus-rs
|
||||
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Client_Observer.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/client_observer.rs`, see https://github.com/diwic/dbus-rs
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -35,8 +35,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ClientObserver,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ClientObserver>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Client.Observer", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -53,7 +53,8 @@ where
|
||||
let requests_satisfied: Vec<dbus::Path> = i.read()?;
|
||||
let observer_info: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
|
||||
i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.observe_channels(
|
||||
account,
|
||||
connection,
|
||||
@@ -83,7 +84,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.observer_channel_filter()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -94,7 +96,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.recover()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -105,7 +108,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.delay_approvers()?);
|
||||
Ok(())
|
||||
});
|
||||
|
Reference in New Issue
Block a user