Skip to content

Commit

Permalink
Use keyexpr lifetime as lifetime of AdvancedPublisher (#1671)
Browse files Browse the repository at this point in the history
  • Loading branch information
oteffahi authored Dec 19, 2024
1 parent a6bc509 commit 9640d22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zenoh-ext/src/advanced_publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ impl QoSBuilderTrait for AdvancedPublisherBuilder<'_, '_, '_> {
}

#[zenoh_macros::unstable]
impl<'a> Resolvable for AdvancedPublisherBuilder<'a, '_, '_> {
type To = ZResult<AdvancedPublisher<'a>>;
impl<'b> Resolvable for AdvancedPublisherBuilder<'_, 'b, '_> {
type To = ZResult<AdvancedPublisher<'b>>;
}

#[zenoh_macros::unstable]
Expand Down Expand Up @@ -238,7 +238,7 @@ pub struct AdvancedPublisher<'a> {
#[zenoh_macros::unstable]
impl<'a> AdvancedPublisher<'a> {
#[zenoh_macros::unstable]
fn new(conf: AdvancedPublisherBuilder<'a, '_, '_>) -> ZResult<Self> {
fn new(conf: AdvancedPublisherBuilder<'_, 'a, '_>) -> ZResult<Self> {
let key_expr = conf.pub_key_expr?;
let meta = match conf.meta_key_expr {
Some(meta) => Some(meta?),
Expand All @@ -247,7 +247,7 @@ impl<'a> AdvancedPublisher<'a> {

let publisher = conf
.session
.declare_publisher(key_expr.clone().into_owned())
.declare_publisher(key_expr.clone())
.encoding(conf.encoding)
.allowed_destination(conf.destination)
.reliability(conf.reliability)
Expand Down Expand Up @@ -286,7 +286,7 @@ impl<'a> AdvancedPublisher<'a> {

let cache = if conf.cache {
Some(
AdvancedCacheBuilder::new(conf.session, Ok(key_expr.clone().into_owned()))
AdvancedCacheBuilder::new(conf.session, Ok(key_expr.clone()))
.history(conf.history)
.queryable_prefix(&prefix)
.wait()?,
Expand Down

0 comments on commit 9640d22

Please sign in to comment.