Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Apr 1, 2024
1 parent 4d0f6e5 commit 23931f9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion plugins/zenoh-plugin-rest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use zenoh::plugins::{RunningPluginTrait, ZenohPlugin};
use zenoh::prelude::r#async::*;
use zenoh::query::{QueryConsolidation, Reply};
use zenoh::runtime::Runtime;
use zenoh::sample::builder::ValueBuilderTrait;
use zenoh::selector::TIME_RANGE_KEY;
use zenoh::Session;
use zenoh_plugin_trait::{plugin_long_version, plugin_version, Plugin, PluginControl};
Expand Down
1 change: 0 additions & 1 deletion zenoh/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//! Query primitives.
use crate::handlers::{locked, Callback, DefaultHandler};
use crate::prelude::*;
use crate::sample::builder::{QoSBuilderTrait, SampleBuilderTrait, ValueBuilderTrait};
#[zenoh_macros::unstable]
use crate::sample::Attachment;
use crate::sample::QoSBuilder;
Expand Down
2 changes: 2 additions & 0 deletions zenoh/src/sample/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@

use std::marker::PhantomData;

#[cfg(feature = "unstable")]
use crate::sample::Attachment;
use crate::sample::QoS;
use crate::sample::QoSBuilder;
#[cfg(feature = "unstable")]
use crate::sample::SourceInfo;
use crate::Encoding;
use crate::KeyExpr;
Expand Down
8 changes: 7 additions & 1 deletion zenoh/src/sample/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ impl DataInfoIntoSample for Option<DataInfo> {
IntoPayload: Into<Payload>,
{
if let Some(data_info) = self {
data_info.into_sample(key_expr, payload, attachment)
data_info.into_sample(
key_expr,
payload,
#[cfg(feature = "unstable")]
attachment,
)
} else {
Sample {
key_expr: key_expr.into(),
Expand Down Expand Up @@ -172,6 +177,7 @@ impl SourceInfo {
}
}

#[zenoh_macros::unstable]
impl From<SourceInfo> for Option<zenoh::put::ext::SourceInfoType> {
fn from(source_info: SourceInfo) -> Option<zenoh::put::ext::SourceInfoType> {
if source_info.is_empty() {
Expand Down
1 change: 1 addition & 0 deletions zenoh/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ impl Session {
#[cfg(feature = "unstable")]
attachment: None,
handler: DefaultHandler,
#[cfg(feature = "unstable")]
source_info: SourceInfo::empty(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/attachments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#[cfg(feature = "unstable")]
#[test]
fn pubsub() {
use zenoh::{prelude::sync::*, sample::builder::SampleBuilderTrait};
use zenoh::prelude::sync::*;

let zenoh = zenoh::open(Config::default()).res().unwrap();
let _sub = zenoh
Expand Down

0 comments on commit 23931f9

Please sign in to comment.