From 19eb91c72b866c1325e886fa165fcdfdbeb2b9dc Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 30 Apr 2018 13:05:28 +0200 Subject: [PATCH] Rename tls::Client to ClientTls --- src/client.rs | 6 +++--- src/tests.rs | 4 ++-- src/tls.rs | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/client.rs b/src/client.rs index a21d0b974..ddbb00ceb 100644 --- a/src/client.rs +++ b/src/client.rs @@ -3,7 +3,7 @@ use futures::{Async, Future, Poll}; use crypto::{self, PacketKey}; use frame::{Ack, AckFrame, Frame, StreamFrame}; use packet::{DRAFT_10, Header, LongType, Packet, PartialDecode}; -use tls; +use tls::ClientTls; use types::Endpoint; use std::io; @@ -95,14 +95,14 @@ impl Future for ConnectFuture { pub(crate) struct ClientStreamState { pub(crate) endpoint: Endpoint, - pub(crate) tls: tls::Client, + pub(crate) tls: ClientTls, } impl ClientStreamState { pub fn new() -> Self { Self { endpoint: Endpoint::new(), - tls: tls::Client::new(), + tls: ClientTls::new(), } } diff --git a/src/tests.rs b/src/tests.rs index bd85ecd35..9ff519c53 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use client::ClientStreamState; use server::ServerStreamState; -use tls; +use tls::{self, ClientTls}; use types::Endpoint; use self::untrusted::Input; @@ -52,7 +52,7 @@ fn client_state() -> ClientStreamState { webpki::trust_anchor_util::cert_der_as_trust_anchor(Input::from(&bytes)).unwrap(); let anchor_vec = vec![anchor]; let config = tls::build_client_config(Some(&webpki::TLSServerTrustAnchors(&anchor_vec))); - tls::Client::with_config(config) + ClientTls::with_config(config) }; ClientStreamState { diff --git a/src/tls.rs b/src/tls.rs index 63588d4bb..ba5eabd36 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -15,17 +15,17 @@ pub use rustls::internal::msgs::quic::{Parameter, ServerTransportParameters}; pub use rustls::{Certificate, PrivateKey, ServerConfig, Session, TLSError}; pub use rustls::quic::ServerSession; -pub struct Client { +pub struct ClientTls { pub session: ClientSession, } -impl Client { - pub fn new() -> Client { +impl ClientTls { + pub fn new() -> Self { Self::with_config(build_client_config(None)) } - pub fn with_config(config: ClientConfig) -> Client { - Client { + pub fn with_config(config: ClientConfig) -> Self { + Self { session: ClientSession::new(&Arc::new(config)), } }