Skip to content

Commit

Permalink
Fix some erroneous prelude usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Mar 2, 2024
1 parent 38d8ab7 commit bb7ba70
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
4 changes: 3 additions & 1 deletion zenoh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ extern crate zenoh_core;
#[macro_use]
extern crate zenoh_result;

pub(crate) type Id = usize;

use git_version::git_version;
use handlers::DefaultHandler;
#[zenoh_macros::unstable]
#[cfg(feature = "unstable")]
use net::runtime::Runtime;
use prelude::*;
use scouting::ScoutBuilder;
Expand Down
5 changes: 2 additions & 3 deletions zenoh/src/liveliness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
//! Liveliness primitives.
//!
//! see [`Liveliness`]
use crate::query::Reply;
use crate::{query::Reply, Id};

#[zenoh_macros::unstable]
use {
Expand Down Expand Up @@ -508,7 +507,7 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> {
#[zenoh_macros::unstable]
pub fn with<Handler>(self, handler: Handler) -> LivelinessSubscriberBuilder<'a, 'b, Handler>
where
Handler: crate::prelude::IntoCallbackReceiverPair<'static, Sample>,
Handler: crate::handlers::IntoCallbackReceiverPair<'static, Sample>,
{
let LivelinessSubscriberBuilder {
session,
Expand Down
2 changes: 0 additions & 2 deletions zenoh/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ pub(crate) mod common {
pub use zenoh_core::Resolve;
pub use zenoh_protocol::core::{Encoding, EncodingPrefix, EndPoint, Locator, ZenohId};

pub(crate) type Id = usize;

pub use crate::config::{self, Config, ValidatedMap};
pub use crate::handlers::IntoCallbackReceiverPair;
pub use crate::session::{Session, SessionDeclarations};
Expand Down
22 changes: 13 additions & 9 deletions zenoh/src/publication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@
//

//! Publishing primitives.
#[zenoh_macros::unstable]
use crate::handlers::Callback;
#[zenoh_macros::unstable]
use crate::handlers::DefaultHandler;
use crate::key_expr::KeyExpr;
use crate::net::primitives::Primitives;
use crate::payload::Payload;
use crate::prelude::*;
#[zenoh_macros::unstable]
use crate::sample::Attachment;
use crate::sample::DataInfo;
use crate::Encoding;
use crate::sample::{DataInfo, Sample, SampleKind};
use crate::Locality;
use crate::SessionRef;
use crate::Undeclarable;
#[cfg(feature = "unstable")]
use crate::{
handlers::{Callback, DefaultHandler, IntoCallbackReceiverPair},
sample::Attachment,
};
use std::future::Ready;
use zenoh_core::{zread, AsyncResolve, Resolvable, Resolve, SyncResolve};
use zenoh_keyexpr::keyexpr;
use zenoh_protocol::core::Encoding;
use zenoh_protocol::network::push::ext;
use zenoh_protocol::network::Mapping;
use zenoh_protocol::network::Push;
Expand All @@ -36,6 +37,9 @@ use zenoh_protocol::zenoh::PushBody;
use zenoh_protocol::zenoh::Put;
use zenoh_result::ZResult;

#[cfg(feature = "unstable")]
pub(crate) type Id = usize;

/// The kind of congestion control.
pub use zenoh_protocol::core::CongestionControl;

Expand Down
8 changes: 3 additions & 5 deletions zenoh/src/queryable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
use crate::handlers::{locked, DefaultHandler};
use crate::net::primitives::Primitives;
use crate::prelude::*;
#[zenoh_macros::unstable]
use crate::query::ReplyKeyExpr;
#[zenoh_macros::unstable]
use crate::sample::Attachment;
use crate::sample::DataInfo;
use crate::Id;
use crate::SessionRef;
use crate::Undeclarable;

#[cfg(feature = "unstable")]
use crate::{query::ReplyKeyExpr, sample::Attachment};
use std::fmt;
use std::future::Ready;
use std::ops::Deref;
Expand Down
6 changes: 4 additions & 2 deletions zenoh/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
//

//! Subscribing primitives.
use crate::handlers::{locked, Callback, DefaultHandler};
use crate::handlers::{locked, Callback, DefaultHandler, IntoCallbackReceiverPair};
use crate::key_expr::KeyExpr;
use crate::prelude::Locality;
use crate::prelude::{Id, IntoCallbackReceiverPair, KeyExpr, Sample};
use crate::sample::Sample;
use crate::Id;
use crate::Undeclarable;
use crate::{Result as ZResult, SessionRef};
use std::fmt;
Expand Down

0 comments on commit bb7ba70

Please sign in to comment.