Skip to content

Commit

Permalink
Fix Selector lifetime (#1442)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets authored Sep 18, 2024
1 parent c52b416 commit c55ab40
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions zenoh/src/api/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,20 @@ pub struct Selector<'a> {

impl<'a> Selector<'a> {
/// Get the [`KeyExpr`] of this selector.
pub fn key_expr(&'a self) -> &'a KeyExpr<'a> {
pub fn key_expr(&self) -> &KeyExpr<'a> {
&self.key_expr
}

/// Get the [`KeyExpr`] of this selector.
pub fn parameters(&'a self) -> &'a Parameters<'a> {
/// Get the [`Parameters`] of this selector.
pub fn parameters(&self) -> &Parameters<'a> {
&self.parameters
}

/// Deconstruct the selector into ([`KeyExpr`], [`Parameters`])
pub fn split(self) -> (KeyExpr<'a>, Parameters<'a>) {
self.into()
}

/// Builds a new selector which owns keyexpr and parameters
pub fn owned<K, P>(key_expr: K, parameters: P) -> Self
where
Expand Down

0 comments on commit c55ab40

Please sign in to comment.