Skip to content

Commit f66d67b

Browse files
committed
cargo fmt
1 parent b3551a4 commit f66d67b

File tree

25 files changed

+40
-42
lines changed

25 files changed

+40
-42
lines changed

src/client/builder.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
//! Everything you need to create a client connection to a websocket.
22
33
use crate::header::extensions::Extension;
4-
use crate::header::{Origin, WebSocketExtensions, WebSocketKey, WebSocketProtocol, WebSocketVersion};
4+
use crate::header::{
5+
Origin, WebSocketExtensions, WebSocketKey, WebSocketProtocol, WebSocketVersion,
6+
};
57
use hyper::header::{Authorization, Basic, Header, HeaderFormat, Headers};
68
use hyper::version::HttpVersion;
79
use std::borrow::Cow;
@@ -11,6 +13,8 @@ pub use url::{ParseError, Url};
1113
#[cfg(any(feature = "sync", feature = "async"))]
1214
mod common_imports {
1315
pub use crate::header::WebSocketAccept;
16+
pub use crate::result::{WSUrlErrorKind, WebSocketError, WebSocketOtherError, WebSocketResult};
17+
pub use crate::stream::{self, Stream};
1418
pub use hyper::buffer::BufReader;
1519
pub use hyper::header::{Connection, ConnectionOption, Host, Protocol, ProtocolName, Upgrade};
1620
pub use hyper::http::h1::parse_response;
@@ -19,10 +23,8 @@ mod common_imports {
1923
pub use hyper::method::Method;
2024
pub use hyper::status::StatusCode;
2125
pub use hyper::uri::RequestUri;
22-
pub use crate::result::{WSUrlErrorKind, WebSocketError, WebSocketOtherError, WebSocketResult};
2326
pub use std::net::TcpStream;
2427
pub use std::net::ToSocketAddrs;
25-
pub use crate::stream::{self, Stream};
2628
pub use unicase::UniCase;
2729
pub use url::Position;
2830
}
@@ -44,6 +46,7 @@ use native_tls::TlsStream;
4446
mod async_imports {
4547
pub use super::super::r#async;
4648
pub use crate::codec::ws::{Context, MessageCodec};
49+
pub use crate::ws::util::update_framed_codec;
4750
pub use futures::future;
4851
pub use futures::Stream as FutureStream;
4952
pub use futures::{Future, IntoFuture, Sink};
@@ -53,7 +56,6 @@ mod async_imports {
5356
pub use tokio_tcp::TcpStream as TcpStreamNew;
5457
#[cfg(feature = "async-ssl")]
5558
pub use tokio_tls::TlsConnector as TlsConnectorExt;
56-
pub use crate::ws::util::update_framed_codec;
5759
}
5860
#[cfg(feature = "async")]
5961
use self::async_imports::*;

src/codec/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@ impl From<hyper::Error> for HttpCodecError {
255255
#[cfg(test)]
256256
mod tests {
257257
use super::*;
258+
use crate::stream::ReadWritePair;
258259
use futures::{Future, Sink, Stream};
259260
use hyper::header::Headers;
260261
use hyper::version::HttpVersion;
261262
use std::io::Cursor;
262-
use crate::stream::ReadWritePair;
263263
use tokio::runtime::current_thread::Builder;
264264

265265
#[test]

src/header/accept.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::header::WebSocketKey;
2+
use crate::result::{WebSocketError, WebSocketResult};
23
use hyper;
34
use hyper::header::parsing::from_one_raw_str;
45
use hyper::header::{Header, HeaderFormat};
5-
use crate::result::{WebSocketError, WebSocketResult};
66
use std::fmt::{self, Debug};
77
use std::str::FromStr;
88

src/header/extensions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Provides the Sec-WebSocket-Extensions header.
22
3+
use crate::result::{WebSocketError, WebSocketResult};
34
use hyper;
45
use hyper::header::parsing::{fmt_comma_delimited, from_comma_delimited};
56
use hyper::header::{Header, HeaderFormat};
6-
use crate::result::{WebSocketError, WebSocketResult};
77
use std::fmt;
88
use std::ops::Deref;
99
use std::str::FromStr;

src/header/key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use crate::result::{WebSocketError, WebSocketResult};
12
use hyper;
23
use hyper::header::parsing::from_one_raw_str;
34
use hyper::header::{Header, HeaderFormat};
4-
use crate::result::{WebSocketError, WebSocketResult};
55
use std::fmt::{self, Debug};
66
use std::str::FromStr;
77

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
clippy::write_with_newline,
55
clippy::type_complexity,
66
clippy::match_ref_pats,
7-
clippy::needless_doctest_main,
7+
clippy::needless_doctest_main
88
)]
99
#![deny(unused_mut)]
1010

@@ -142,8 +142,8 @@ pub mod r#async {
142142

143143
/// A collection of handy asynchronous-only parts of the `client` module.
144144
pub mod client {
145-
pub use crate::client::r#async::*;
146145
pub use crate::client::builder::ClientBuilder;
146+
pub use crate::client::r#async::*;
147147
}
148148
pub use crate::client::r#async::Client;
149149

src/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! The result type used within Rust-WebSocket
22
3+
use crate::server::upgrade::HyperIntoWsError;
34
pub use hyper::status::StatusCode;
45
use hyper::Error as HttpError;
5-
use crate::server::upgrade::HyperIntoWsError;
66
use std::convert::From;
77
use std::error::Error;
88
use std::fmt;

src/sender.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//! The default implementation of a WebSocket Sender.
22
33
use crate::result::WebSocketResult;
4-
use std::io::Result as IoResult;
5-
use std::io::Write;
64
use crate::stream::sync::AsTcpStream;
75
pub use crate::stream::sync::Shutdown;
86
use crate::ws;
97
use crate::ws::dataframe::DataFrame;
108
use crate::ws::sender::Sender as SenderTrait;
9+
use std::io::Result as IoResult;
10+
use std::io::Write;
1111

1212
/// A writer that bundles a stream with a serializer to send the messages.
1313
/// This is used in the client's `.split()` function as the writing component.

src/server/async.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! The asynchronous implementation of a websocket server.
2-
use bytes::BytesMut;
3-
use futures;
4-
use futures::{Future, Stream};
52
use crate::server::upgrade::r#async::{IntoWs, Upgrade};
63
use crate::server::InvalidConnection;
74
use crate::server::{NoTlsAcceptor, OptionalTlsAcceptor, WsServer};
5+
use bytes::BytesMut;
6+
use futures;
7+
use futures::{Future, Stream};
88
use std;
99
use std::io;
1010
use std::net::SocketAddr;

src/server/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use native_tls::TlsAcceptor;
44

55
use self::upgrade::{HyperIntoWsError, Request};
6-
use std::fmt::{Debug, Formatter, Result as FmtResult};
76
use crate::stream::Stream;
7+
use std::fmt::{Debug, Formatter, Result as FmtResult};
88

99
pub mod upgrade;
1010

0 commit comments

Comments
 (0)