Skip to content

Commit

Permalink
fix: fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfo committed Sep 6, 2024
1 parent a1c608f commit 91637e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion zenoh/src/api/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#[cfg(feature = "unstable")]
use std::mem::size_of;
use std::{
convert::TryFrom,
fmt,
future::{IntoFuture, Ready},
mem::size_of,
pin::Pin,
task::{Context, Poll},
};
Expand Down
20 changes: 11 additions & 9 deletions zenoh/src/api/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2801,22 +2801,24 @@ impl Resolvable for InitBuilder {
#[zenoh_macros::internal]
impl Wait for InitBuilder {
fn wait(self) -> <Self as Resolvable>::To {
Ok(Session::init(
self.runtime,
self.aggregated_subscribers,
self.aggregated_publishers,
false,
)
.wait())
zenoh_runtime::ZRuntime::Application.block_in_place(async move { self.await })
}
}

#[zenoh_macros::internal]
impl IntoFuture for InitBuilder {
type Output = <Self as Resolvable>::To;
type IntoFuture = Ready<<Self as Resolvable>::To>;
type IntoFuture = Pin<Box<dyn Future<Output = Self::Output> + Send>>;

fn into_future(self) -> Self::IntoFuture {
std::future::ready(self.wait())
Box::pin(async move {
Ok(Session::init(
self.runtime,
self.aggregated_subscribers,
self.aggregated_publishers,
false,
)
.await)
})
}
}

0 comments on commit 91637e3

Please sign in to comment.