From 5d0ed9eb2ebc96cac36485d15d754b12918e8aa7 Mon Sep 17 00:00:00 2001 From: Atul Bhosale Date: Sun, 12 Jul 2020 22:17:00 +0530 Subject: [PATCH 1/2] Add cargo fmt to travis build config --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9efee9d..1acf8cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,12 @@ matrix: os: osx script: + - | + if [[ "$TRAVIS_RUST_VERSION" == stable ]] + then + rustup component add rustfmt + cargo fmt --all -- --check + fi - cargo test - cargo test --features early-data - cd examples/server From 6b2d3bdb2b33317ab1fb395a5dbfadd4db12ba1e Mon Sep 17 00:00:00 2001 From: Atul Bhosale Date: Mon, 13 Jul 2020 18:29:24 +0530 Subject: [PATCH 2/2] Format code using 'cargo fmt' --- tests/test.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index d7871ba..d0f4ffa 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,14 +1,14 @@ -use async_std::net::{TcpListener, TcpStream}; -use async_std::task; use async_std::io; -use async_std::sync::channel; +use async_std::net::{TcpListener, TcpStream}; use async_std::prelude::*; +use async_std::sync::channel; +use async_std::task; use async_tls::{TlsAcceptor, TlsConnector}; use lazy_static::lazy_static; use rustls::internal::pemfile::{certs, rsa_private_keys}; use rustls::{ClientConfig, ServerConfig}; -use std::net::SocketAddr; use std::io::{BufReader, Cursor}; +use std::net::SocketAddr; use std::sync::Arc; const CERT: &str = include_str!("end.cert"); @@ -49,9 +49,7 @@ lazy_static! { Ok(()) as io::Result<()> }); - let addr = task::block_on(async move { - recv.recv().await.unwrap() - }); + let addr = task::block_on(async move { recv.recv().await.unwrap() }); (addr, "localhost", CHAIN) }; }