Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a handful of lints, one of which was breaking the build #65

Merged
merged 2 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tokio-native-tls/examples/echo.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#![warn(rust_2018_idioms)]

// A tiny async TLS echo server with Tokio
use native_tls;
use native_tls::Identity;
use tokio;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::net::TcpListener;

Expand Down
1 change: 0 additions & 1 deletion tokio-native-tls/tests/bad.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![warn(rust_2018_idioms)]

use cfg_if::cfg_if;
use env_logger;
use native_tls::TlsConnector;
use std::io::{self, Error};
use std::net::ToSocketAddrs;
Expand Down
2 changes: 0 additions & 2 deletions tokio-native-tls/tests/google.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#![warn(rust_2018_idioms)]

use cfg_if::cfg_if;
use env_logger;
use native_tls;
use native_tls::TlsConnector;
use std::io;
use std::net::ToSocketAddrs;
Expand Down
2 changes: 1 addition & 1 deletion tokio-native-tls/tests/smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async fn one_byte_at_a_time() {
match socket.read_exact(&mut buf).await {
Ok(_) => data.extend_from_slice(&buf),
Err(ref err) if err.kind() == std::io::ErrorKind::UnexpectedEof => break,
Err(err) => panic!(err),
Err(err) => panic!("{}", err),
}
}
data
Expand Down
2 changes: 1 addition & 1 deletion tokio-rustls/src/common/test_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl AsyncWrite for Eof {

#[tokio::test]
async fn stream_good() -> io::Result<()> {
const FILE: &'static [u8] = include_bytes!("../../README.md");
const FILE: &[u8] = include_bytes!("../../README.md");

let (mut server, mut client) = make_pair();
poll_fn(|cx| do_handshake(&mut client, &mut server, cx)).await?;
Expand Down
6 changes: 3 additions & 3 deletions tokio-rustls/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn start_server() -> &'static (SocketAddr, &'static str, &'static str) {
}

async fn start_client(addr: SocketAddr, domain: &str, config: Arc<ClientConfig>) -> io::Result<()> {
const FILE: &'static [u8] = include_bytes!("../README.md");
const FILE: &[u8] = include_bytes!("../README.md");

let domain = webpki::DNSNameRef::try_from_ascii_str(domain).unwrap();
let config = TlsConnector::from(config);
Expand Down Expand Up @@ -107,7 +107,7 @@ async fn pass() -> io::Result<()> {
config.root_store.add_pem_file(&mut chain).unwrap();
let config = Arc::new(config);

start_client(addr.clone(), domain, config.clone()).await?;
start_client(*addr, domain, config.clone()).await?;

Ok(())
}
Expand All @@ -122,7 +122,7 @@ async fn fail() -> io::Result<()> {
let config = Arc::new(config);

assert_ne!(domain, &"google.com");
let ret = start_client(addr.clone(), "google.com", config).await;
let ret = start_client(*addr, "google.com", config).await;
assert!(ret.is_err());

Ok(())
Expand Down