Formatting with rustfmt

This commit is contained in:
Alexis Mousset
2015-10-12 02:19:33 +02:00
parent 47d6870d93
commit 5f911dce12
4 changed files with 7 additions and 7 deletions

View File

@@ -61,9 +61,7 @@ impl<S: Write + Read = NetworkStream> Client<S> {
/// ///
/// It does not connects to the server, but only creates the `Client` /// It does not connects to the server, but only creates the `Client`
pub fn new() -> Client<S> { pub fn new() -> Client<S> {
Client { Client { stream: None }
stream: None,
}
} }
} }

View File

@@ -32,8 +32,8 @@ impl Connector for NetworkStream {
fn upgrade_tls(&mut self, ssl_context: &SslContext) -> io::Result<()> { fn upgrade_tls(&mut self, ssl_context: &SslContext) -> io::Result<()> {
*self = match self.clone() { *self = match self.clone() {
NetworkStream::Plain(stream) => match SslStream::new(ssl_context, stream) { NetworkStream::Plain(stream) => match SslStream::new(ssl_context, stream) {
Ok(ssl_stream) => NetworkStream::Ssl(ssl_stream), Ok(ssl_stream) => NetworkStream::Ssl(ssl_stream),
Err(err) => return Err(io::Error::new(ErrorKind::Other, err)), Err(err) => return Err(io::Error::new(ErrorKind::Other, err)),
}, },
NetworkStream::Ssl(stream) => NetworkStream::Ssl(stream), NetworkStream::Ssl(stream) => NetworkStream::Ssl(stream),
}; };

View File

@@ -78,7 +78,8 @@
//! .hello_name("my.hostname.tld") //! .hello_name("my.hostname.tld")
//! // Add credentials for authentication //! // Add credentials for authentication
//! .credentials("username", "password") //! .credentials("username", "password")
//! // Use TLS with STARTTLS, you can also specify a specific SSL context with `.ssl_context(context)` //! // Use TLS with STARTTLS, you can also specify a specific SSL context
//! // with `.ssl_context(context)`
//! .starttls() //! .starttls()
//! // Configure accepted authetication mecanisms //! // Configure accepted authetication mecanisms
//! .authentication_mecanisms(vec![Mecanism::CramMd5]) //! .authentication_mecanisms(vec![Mecanism::CramMd5])

View File

@@ -212,7 +212,8 @@ impl Sender {
if self.client_info.ssl_context.is_some() { if self.client_info.ssl_context.is_some() {
try_smtp!(self.client.starttls(), self); try_smtp!(self.client.starttls(), self);
try!(self.client.upgrade_tls_stream(self.client_info.ssl_context.as_ref().unwrap())); try!(self.client
.upgrade_tls_stream(self.client_info.ssl_context.as_ref().unwrap()));
try!(self.get_ehlo()); try!(self.get_ehlo());
} }