Skip to content

Commit

Permalink
fix: remove useless lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfo committed Sep 11, 2024
1 parent 09317d6 commit f83eb8f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 deletions.
22 changes: 8 additions & 14 deletions zenoh-ext/src/querying_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl<'a, 'b, KeySpace> QueryingSubscriberBuilder<'a, 'b, KeySpace, DefaultHandle
}
}

impl<'a, 'b, Handler> QueryingSubscriberBuilder<'a, 'b, crate::UserSpace, Handler> {
impl<'b, Handler> QueryingSubscriberBuilder<'_, 'b, crate::UserSpace, Handler> {
/// Change the subscription reliability.
#[cfg(feature = "unstable")]
#[deprecated(
Expand Down Expand Up @@ -207,7 +207,7 @@ impl<'a, 'b, Handler> QueryingSubscriberBuilder<'a, 'b, crate::UserSpace, Handle
}
}

impl<'a, 'b, KeySpace, Handler> QueryingSubscriberBuilder<'a, 'b, KeySpace, Handler> {
impl<KeySpace, Handler> QueryingSubscriberBuilder<'_, '_, KeySpace, Handler> {
/// Change the timeout to be used for queries.
#[inline]
pub fn query_timeout(mut self, query_timeout: Duration) -> Self {
Expand All @@ -228,7 +228,7 @@ impl<'a, 'b, KeySpace, Handler> QueryingSubscriberBuilder<'a, 'b, KeySpace, Hand
}
}

impl<'a, KeySpace, Handler> Resolvable for QueryingSubscriberBuilder<'a, '_, KeySpace, Handler>
impl<KeySpace, Handler> Resolvable for QueryingSubscriberBuilder<'_, '_, KeySpace, Handler>
where
Handler: IntoHandler<'static, Sample>,
Handler::Handler: Send,
Expand Down Expand Up @@ -285,7 +285,7 @@ where
}
}

impl<'a, KeySpace, Handler> IntoFuture for QueryingSubscriberBuilder<'a, '_, KeySpace, Handler>
impl<KeySpace, Handler> IntoFuture for QueryingSubscriberBuilder<'_, '_, KeySpace, Handler>
where
KeySpace: Into<crate::KeySpace> + Clone,
Handler: IntoHandler<'static, Sample> + Send,
Expand Down Expand Up @@ -495,12 +495,10 @@ where
}

impl<
'a,
'b,
Handler,
Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> ZResult<()>,
TryIntoSample,
> FetchingSubscriberBuilder<'a, 'b, crate::UserSpace, Handler, Fetch, TryIntoSample>
> FetchingSubscriberBuilder<'_, '_, crate::UserSpace, Handler, Fetch, TryIntoSample>
where
TryIntoSample: ExtractSample,
{
Expand Down Expand Up @@ -548,13 +546,11 @@ where
}

impl<
'a,
'b,
KeySpace,
Handler,
Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> ZResult<()>,
TryIntoSample,
> FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample>
> FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>
where
TryIntoSample: ExtractSample,
{
Expand All @@ -572,12 +568,11 @@ where
}

impl<
'a,
KeySpace,
Handler,
Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> ZResult<()>,
TryIntoSample,
> Resolvable for FetchingSubscriberBuilder<'a, '_, KeySpace, Handler, Fetch, TryIntoSample>
> Resolvable for FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>
where
Handler: IntoHandler<'static, Sample>,
Handler::Handler: Send,
Expand All @@ -604,12 +599,11 @@ where
}

impl<
'a,
KeySpace,
Handler,
Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> ZResult<()> + Send + Sync,
TryIntoSample,
> IntoFuture for FetchingSubscriberBuilder<'a, '_, KeySpace, Handler, Fetch, TryIntoSample>
> IntoFuture for FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>
where
KeySpace: Into<crate::KeySpace>,
Handler: IntoHandler<'static, Sample> + Send,
Expand Down
6 changes: 3 additions & 3 deletions zenoh/src/api/liveliness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ where
}

#[zenoh_macros::unstable]
impl<'a, Handler> Wait for LivelinessSubscriberBuilder<'a, '_, Handler>
impl<Handler> Wait for LivelinessSubscriberBuilder<'_, '_, Handler>
where
Handler: IntoHandler<'static, Sample> + Send,
Handler::Handler: Send,
Expand Down Expand Up @@ -610,7 +610,7 @@ where
}

#[zenoh_macros::unstable]
impl<'a, Handler> IntoFuture for LivelinessSubscriberBuilder<'a, '_, Handler>
impl<Handler> IntoFuture for LivelinessSubscriberBuilder<'_, '_, Handler>
where
Handler: IntoHandler<'static, Sample> + Send,
Handler::Handler: Send,
Expand Down Expand Up @@ -750,7 +750,7 @@ impl<'a, 'b> LivelinessGetBuilder<'a, 'b, DefaultHandler> {
}
}

impl<'a, 'b, Handler> LivelinessGetBuilder<'a, 'b, Handler> {
impl<Handler> LivelinessGetBuilder<'_, '_, Handler> {
/// Set query timeout.
#[inline]
pub fn timeout(mut self, timeout: Duration) -> Self {
Expand Down
6 changes: 3 additions & 3 deletions zenoh/src/api/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ impl<Handler> MatchingListenerBuilder<'_, '_, Handler> {
}

#[zenoh_macros::unstable]
impl<'a, 'b, Handler> Resolvable for MatchingListenerBuilder<'a, 'b, Handler>
impl<Handler> Resolvable for MatchingListenerBuilder<'_, '_, Handler>
where
Handler: IntoHandler<'static, MatchingStatus> + Send,
Handler::Handler: Send,
Expand All @@ -765,7 +765,7 @@ where
}

#[zenoh_macros::unstable]
impl<'a, 'b, Handler> Wait for MatchingListenerBuilder<'a, 'b, Handler>
impl<Handler> Wait for MatchingListenerBuilder<'_, '_, Handler>
where
Handler: IntoHandler<'static, MatchingStatus> + Send,
Handler::Handler: Send,
Expand All @@ -791,7 +791,7 @@ where
}

#[zenoh_macros::unstable]
impl<'a, 'b, Handler> IntoFuture for MatchingListenerBuilder<'a, 'b, Handler>
impl<Handler> IntoFuture for MatchingListenerBuilder<'_, '_, Handler>
where
Handler: IntoHandler<'static, MatchingStatus> + Send,
Handler::Handler: Send,
Expand Down
2 changes: 1 addition & 1 deletion zenoh/src/api/queryable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ impl<'a, 'b> QueryableBuilder<'a, 'b, DefaultHandler> {
}
}

impl<'a, 'b, Handler> QueryableBuilder<'a, 'b, Handler> {
impl<Handler> QueryableBuilder<'_, '_, Handler> {
/// Change queryable completeness.
#[inline]
pub fn complete(mut self, complete: bool) -> Self {
Expand Down
8 changes: 4 additions & 4 deletions zenoh/src/api/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl<'a, 'b> SubscriberBuilder<'a, 'b, DefaultHandler> {
}
}

impl<'a, 'b, Handler> SubscriberBuilder<'a, 'b, Handler> {
impl<Handler> SubscriberBuilder<'_, '_, Handler> {
/// Change the subscription reliability.
#[cfg(feature = "unstable")]
#[deprecated(
Expand Down Expand Up @@ -309,15 +309,15 @@ impl<'a, 'b, Handler> SubscriberBuilder<'a, 'b, Handler> {
}

// Push mode
impl<'a, Handler> Resolvable for SubscriberBuilder<'a, '_, Handler>
impl<Handler> Resolvable for SubscriberBuilder<'_, '_, Handler>
where
Handler: IntoHandler<'static, Sample> + Send,
Handler::Handler: Send,
{
type To = ZResult<Subscriber<Handler::Handler>>;
}

impl<'a, Handler> Wait for SubscriberBuilder<'a, '_, Handler>
impl<Handler> Wait for SubscriberBuilder<'_, '_, Handler>
where
Handler: IntoHandler<'static, Sample> + Send,
Handler::Handler: Send,
Expand All @@ -343,7 +343,7 @@ where
}
}

impl<'a, Handler> IntoFuture for SubscriberBuilder<'a, '_, Handler>
impl<Handler> IntoFuture for SubscriberBuilder<'_, '_, Handler>
where
Handler: IntoHandler<'static, Sample> + Send,
Handler::Handler: Send,
Expand Down

0 comments on commit f83eb8f

Please sign in to comment.