Skip to content

Commit

Permalink
all tests passing, no warns - no std
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavrax committed Aug 30, 2023
1 parent 99c1f94 commit 145b24b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/dx/presence/builders/leave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
encoding::{url_encoded_channel_groups, url_encoded_channels},
headers::{APPLICATION_JSON, CONTENT_TYPE},
},
Deserializer, PubNubError, Transport, TransportMethod, TransportRequest,
Deserializer, PubNubError, TransportMethod, TransportRequest,
},
dx::{
presence::{
Expand All @@ -31,6 +31,9 @@ use crate::{
},
};

#[cfg(feature = "std")]
use crate::core::Transport;

/// The [`LeaveRequestBuilder`] is used to build user `leave` announcement
/// request that is sent to the [`PubNub`] network.
///
Expand Down Expand Up @@ -127,6 +130,7 @@ impl<T, D> LeaveRequest<T, D> {
}
}

#[cfg(feature = "std")]
impl<T, D> LeaveRequestBuilder<T, D>
where
T: Transport,
Expand Down
1 change: 1 addition & 0 deletions src/dx/presence/builders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub(crate) mod heartbeat;
pub use set_presence_state::{SetStateRequest, SetStateRequestBuilder};
pub mod set_presence_state;

#[cfg(feature = "std")]
#[doc(inline)]
pub(crate) use leave::LeaveRequestBuilder;
pub(crate) mod leave;
Expand Down
7 changes: 5 additions & 2 deletions src/dx/presence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ use futures::{
future::{ready, BoxFuture},
{select_biased, FutureExt},
};

#[cfg(feature = "std")]
use spin::RwLock;

use crate::{
core::{Deserializer, PubNubError, Serialize, Transport},
core::{Deserializer, Serialize, Transport},
dx::pubnub_client::PubNubClientInstance,
lib::alloc::string::ToString,
};
Expand Down Expand Up @@ -41,7 +43,7 @@ pub(crate) mod event_engine;
use crate::{
core::{
event_engine::{cancel::CancellationTask, EventEngine},
Runtime,
PubNubError, Runtime,
},
lib::alloc::sync::Arc,
};
Expand Down Expand Up @@ -102,6 +104,7 @@ impl<T, D> PubNubClientInstance<T, D> {
/// `user_id` on channels.
///
/// Instance of [`LeaveRequestBuilder`] returned.
#[cfg(feature = "std")]
pub(in crate::dx::presence) fn leave(&self) -> LeaveRequestBuilder<T, D> {
LeaveRequestBuilder {
pubnub_client: Some(self.clone()),
Expand Down

0 comments on commit 145b24b

Please sign in to comment.