Skip to content

Commit

Permalink
fixed spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
dt665m committed Jul 8, 2020
1 parent 38f19bb commit 2bc5566
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/transport/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! Implementation of [`TransportClient`](crate::transport::TransportClient) and
//! [`TransportServer`](crate::transport::TransportServer) for the WebSocket protocol.
pub use client::{Mode, WsConnecError, WsNewDnsError, WsNewError, WsTransportClient};
pub use client::{Mode, WsConnectError, WsNewDnsError, WsNewError, WsTransportClient};
pub use server::{WsRequestId, WsTransportServer, WsTransportServerBuilder};

mod client;
Expand Down
14 changes: 7 additions & 7 deletions src/transport/ws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub enum WsNewDnsError {

/// Error that can happen during a request.
#[derive(Debug, Error)]
pub enum WsConnecError {
pub enum WsConnectError {
/// Error while serializing the request.
// TODO: can that happen?
#[error("error while serializing the request")]
Expand Down Expand Up @@ -201,14 +201,14 @@ impl WsTransportClient {
}

impl TransportClient for WsTransportClient {
type Error = WsConnecError;
type Error = WsConnectError;

fn send_request<'a>(
&'a mut self,
request: common::Request,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'a>> {
Box::pin(async move {
let request = common::to_vec(&request).map_err(WsConnecError::Serialization)?;
let request = common::to_vec(&request).map_err(WsConnectError::Serialization)?;
self.sender.send_binary(request).await?;
self.sender.flush().await?;
Ok(())
Expand All @@ -221,7 +221,7 @@ impl TransportClient for WsTransportClient {
Box::pin(async move {
let mut message = Vec::new();
self.receiver.receive_data(&mut message).await?;
let response = common::from_slice(&message).map_err(WsConnecError::ParseError)?;
let response = common::from_slice(&message).map_err(WsConnectError::ParseError)?;
Ok(response)
})
}
Expand Down Expand Up @@ -326,8 +326,8 @@ impl From<WsNewError> for WsNewDnsError {
}
}

impl From<soketto::connection::Error> for WsConnecError {
fn from(err: soketto::connection::Error) -> WsConnecError {
WsConnecError::Ws(err)
impl From<soketto::connection::Error> for WsConnectError {
fn from(err: soketto::connection::Error) -> WsConnectError {
WsConnectError::Ws(err)
}
}

0 comments on commit 2bc5566

Please sign in to comment.