Commit 65efd1e9 authored by Marc-André Lureau's avatar Marc-André Lureau
Browse files

zb: make some lifetimes more explicit


Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent d3211c7d
......@@ -243,7 +243,7 @@ impl<'a> Proxy<'a> {
}
/// Get a reference to the underlying async Proxy.
pub fn inner(&self) -> &azync::Proxy<'_> {
pub fn inner(&self) -> &azync::Proxy<'a> {
&self.azync
}
......
......@@ -15,7 +15,7 @@ struct ProxyKey<'key> {
path: ObjectPath<'key>,
}
impl<'p, P> From<&P> for ProxyKey<'_>
impl<'p, P> From<&P> for ProxyKey<'static>
where
P: AsRef<Proxy<'p>>,
{
......@@ -36,10 +36,10 @@ where
}
}
impl<'key> TryFrom<&'key MessageHeader<'_>> for ProxyKey<'key> {
impl<'key> TryFrom<&'key MessageHeader<'key>> for ProxyKey<'key> {
type Error = Error;
fn try_from(hdr: &'key MessageHeader<'_>) -> Result<Self> {
fn try_from(hdr: &'key MessageHeader<'key>) -> Result<Self> {
match (hdr.interface()?, hdr.path()?.cloned(), hdr.sender()?) {
(Some(interface), Some(path), Some(destination)) => Ok(ProxyKey {
interface: Cow::from(interface),
......@@ -76,7 +76,7 @@ impl<'a> SignalReceiver<'a> {
}
/// Get a iterator for all the proxies in this receiver.
pub fn proxies(&self) -> impl Iterator<Item = &&Proxy<'_>> {
pub fn proxies(&self) -> impl Iterator<Item = &&Proxy<'a>> {
self.proxies.values()
}
......
......@@ -161,7 +161,7 @@ pub fn create_proxy(args: &[NestedMeta], input: &ItemTrait, azync: bool) -> Toke
}
/// The reference to the underlying `zbus::Proxy`.
pub fn inner(&self) -> &#proxy_struct {
pub fn inner(&self) -> &#proxy_struct<'c> {
&self.0
}
......@@ -250,12 +250,12 @@ fn gen_proxy_method_call(
let (_, ty_generics, where_clause) = m.sig.generics.split_for_impl();
let signature = if where_clause.is_some() {
quote! {
fn #method#ty_generics(#inputs) -> ::#zbus::Result<#proxy<'_>>
fn #method#ty_generics(#inputs) -> ::#zbus::Result<#proxy<'c>>
#where_clause,
}
} else {
quote! {
fn #method(#inputs) -> ::#zbus::Result<#proxy<'_>>
fn #method(#inputs) -> ::#zbus::Result<#proxy<'c>>
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment