Skip to content

Commit

Permalink
Cargo fmt & clippy & doc test
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan committed Feb 15, 2024
1 parent f4aa7df commit db35f9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions zenoh/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2657,12 +2657,13 @@ pub trait SessionDeclarations<'s, 'a> {
///
/// # Examples
/// ```
/// # async_std::task::block_on(async {
/// # #[tokio::main]
/// # async fn main() {
/// use zenoh::prelude::r#async::*;
///
/// let session = zenoh::open(config::peer()).res().await.unwrap();
/// let info = session.info();
/// # })
/// # }
/// ```
fn info(&'s self) -> SessionInfo<'a>;
}
Expand Down
5 changes: 2 additions & 3 deletions zenoh/tests/unicity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::time::Duration;
use tokio::runtime::Handle;
use zenoh::prelude::r#async::*;
use zenoh_core::ztimeout;
use tokio::runtime::Handle;

const TIMEOUT: Duration = Duration::from_secs(60);
const SLEEP: Duration = Duration::from_secs(1);

const MSG_SIZE: [usize; 2] = [1_024, 100_000];


async fn open_p2p_sessions() -> (Session, Session, Session) {
// Open the sessions
let mut config = config::peer();
Expand Down Expand Up @@ -193,7 +192,7 @@ async fn test_unicity_qryrep(s01: &Session, s02: &Session, s03: &Session) {
let rep = Sample::try_from(key_expr, vec![0u8; size]).unwrap();
tokio::task::block_in_place(move || {
Handle::current().block_on(async move {
ztimeout!(sample.reply(Ok(rep)).res_async()).unwrap()
ztimeout!(sample.reply(Ok(rep)).res_async()).unwrap()
});
});
})
Expand Down

0 comments on commit db35f9e

Please sign in to comment.