diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91a68fd..99028e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,24 @@ name: CI on: [push, pull_request] jobs: + style: + name: Check style + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt + profile: minimal + override: true + + - run: cargo fmt -- --check + test: name: Test runs-on: ubuntu-latest diff --git a/src/tokio.rs b/src/tokio.rs index bc6291b..8116368 100644 --- a/src/tokio.rs +++ b/src/tokio.rs @@ -13,9 +13,9 @@ use futures_io::{AsyncRead, AsyncWrite}; #[cfg(all(feature = "tokio-rustls", not(feature = "tokio-native-tls")))] pub(crate) mod tokio_tls { - use real_tokio_rustls::{client::TlsStream, TlsConnector as AsyncTlsConnector}; use real_tokio_rustls::rustls::ClientConfig; use real_tokio_rustls::webpki::DNSNameRef; + use real_tokio_rustls::{client::TlsStream, TlsConnector as AsyncTlsConnector}; use tungstenite::client::{uri_mode, IntoClientRequest}; use tungstenite::handshake::client::Request; @@ -53,7 +53,8 @@ pub(crate) mod tokio_tls { let config = ClientConfig::new(); AsyncTlsConnector::from(std::sync::Arc::new(config)) }; - let domain = DNSNameRef::try_from_ascii_str(&domain).map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?; + let domain = DNSNameRef::try_from_ascii_str(&domain) + .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?; connector .connect(domain, socket) .await