Run rustfmt and enforce via CI

pull/61/head
Constantin Nickel 4 years ago committed by Sebastian Dröge
parent a2468d0431
commit 066af47721
  1. 18
      .github/workflows/ci.yml
  2. 5
      src/tokio.rs

@ -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

@ -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

Loading…
Cancel
Save