Skip to content

Commit 9640d22

Browse files
authored
Use keyexpr lifetime as lifetime of AdvancedPublisher (#1671)
1 parent a6bc509 commit 9640d22

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

zenoh-ext/src/advanced_publisher.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ impl QoSBuilderTrait for AdvancedPublisherBuilder<'_, '_, '_> {
203203
}
204204

205205
#[zenoh_macros::unstable]
206-
impl<'a> Resolvable for AdvancedPublisherBuilder<'a, '_, '_> {
207-
type To = ZResult<AdvancedPublisher<'a>>;
206+
impl<'b> Resolvable for AdvancedPublisherBuilder<'_, 'b, '_> {
207+
type To = ZResult<AdvancedPublisher<'b>>;
208208
}
209209

210210
#[zenoh_macros::unstable]
@@ -238,7 +238,7 @@ pub struct AdvancedPublisher<'a> {
238238
#[zenoh_macros::unstable]
239239
impl<'a> AdvancedPublisher<'a> {
240240
#[zenoh_macros::unstable]
241-
fn new(conf: AdvancedPublisherBuilder<'a, '_, '_>) -> ZResult<Self> {
241+
fn new(conf: AdvancedPublisherBuilder<'_, 'a, '_>) -> ZResult<Self> {
242242
let key_expr = conf.pub_key_expr?;
243243
let meta = match conf.meta_key_expr {
244244
Some(meta) => Some(meta?),
@@ -247,7 +247,7 @@ impl<'a> AdvancedPublisher<'a> {
247247

248248
let publisher = conf
249249
.session
250-
.declare_publisher(key_expr.clone().into_owned())
250+
.declare_publisher(key_expr.clone())
251251
.encoding(conf.encoding)
252252
.allowed_destination(conf.destination)
253253
.reliability(conf.reliability)
@@ -286,7 +286,7 @@ impl<'a> AdvancedPublisher<'a> {
286286

287287
let cache = if conf.cache {
288288
Some(
289-
AdvancedCacheBuilder::new(conf.session, Ok(key_expr.clone().into_owned()))
289+
AdvancedCacheBuilder::new(conf.session, Ok(key_expr.clone()))
290290
.history(conf.history)
291291
.queryable_prefix(&prefix)
292292
.wait()?,

0 commit comments

Comments
 (0)