Skip to content

Commit

Permalink
Change visibility of Sink and Stream
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Mar 27, 2024
1 parent 3c15c19 commit eb82b2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#![forbid(unsafe_code)]

#[cfg(target_arch = "wasm32")]
pub use wasm_ws::WsMessage;
pub use futures_util;
pub use url;

Expand All @@ -14,7 +16,6 @@ pub mod native;
pub mod wasm;

#[cfg(target_arch = "wasm32")]
pub use wasm_ws::WsMessage;

pub use self::wasm::{Sink, Stream};
#[cfg(not(target_arch = "wasm32"))]
pub use self::native::Message as WsMessage;
pub use self::native::{Message as WsMessage, Sink, Stream};
4 changes: 2 additions & 2 deletions src/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use tokio_tungstenite::{MaybeTlsStream, WebSocketStream};
use url::{ParseError, Url};

type WebSocket = WebSocketStream<MaybeTlsStream<TcpStream>>;
type Sink = SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>;
type Stream = SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>;
pub type Sink = SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>;
pub type Stream = SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>;

mod socks;

Expand Down
4 changes: 2 additions & 2 deletions src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use thiserror::Error;
use url::Url;
use wasm_ws::{WebSocket, WsErr, WsMessage, WsStream};

type Sink = SplitSink<WsStream, WsMessage>;
type Stream = SplitStream<WsStream>;
pub type Sink = SplitSink<WsStream, WsMessage>;
pub type Stream = SplitStream<WsStream>;

#[derive(Debug, Error)]
pub enum Error {
Expand Down

0 comments on commit eb82b2b

Please sign in to comment.