Skip to content

Commit 67bace6

Browse files
committed
Rustfmt
1 parent 25b9614 commit 67bace6

19 files changed

+675
-540
lines changed

src/error.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ impl DbErrorNew for DbError {
4848
None => match map.remove(&b'p') {
4949
Some(pos) => Some(ErrorPosition::Internal {
5050
position: try!(pos.parse().map_err(|_| ())),
51-
query: try!(map.remove(&b'q').ok_or(()))
51+
query: try!(map.remove(&b'q').ok_or(())),
5252
}),
53-
None => None
54-
}
53+
None => None,
54+
},
5555
},
5656
where_: map.remove(&b'W'),
5757
schema: map.remove(&b's'),
@@ -194,7 +194,7 @@ impl error::Error for DbError {
194194
#[derive(Debug)]
195195
pub enum ConnectError {
196196
/// An error creating `ConnectParams`.
197-
BadConnectParams(Box<error::Error+Sync+Send>),
197+
BadConnectParams(Box<error::Error + Sync + Send>),
198198
/// The `ConnectParams` was missing a user.
199199
MissingUser,
200200
/// An error from the Postgres server itself.
@@ -207,7 +207,7 @@ pub enum ConnectError {
207207
/// The Postgres server does not support SSL encryption.
208208
NoSslSupport,
209209
/// An error initializing the SSL session.
210-
SslError(Box<error::Error+Sync+Send>),
210+
SslError(Box<error::Error + Sync + Send>),
211211
/// An error communicating with the server.
212212
IoError(io::Error),
213213
}
@@ -220,7 +220,7 @@ impl fmt::Display for ConnectError {
220220
ConnectError::DbError(ref err) => write!(fmt, ": {}", err),
221221
ConnectError::SslError(ref err) => write!(fmt, ": {}", err),
222222
ConnectError::IoError(ref err) => write!(fmt, ": {}", err),
223-
_ => Ok(())
223+
_ => Ok(()),
224224
}
225225
}
226226
}
@@ -231,7 +231,8 @@ impl error::Error for ConnectError {
231231
ConnectError::BadConnectParams(_) => "Error creating `ConnectParams`",
232232
ConnectError::MissingUser => "User missing in `ConnectParams`",
233233
ConnectError::DbError(_) => "Error reported by Postgres",
234-
ConnectError::MissingPassword => "The server requested a password but none was provided",
234+
ConnectError::MissingPassword =>
235+
"The server requested a password but none was provided",
235236
ConnectError::UnsupportedAuthentication => {
236237
"The server requested an unsupported authentication method"
237238
}
@@ -247,7 +248,7 @@ impl error::Error for ConnectError {
247248
ConnectError::DbError(ref err) => Some(&**err),
248249
ConnectError::SslError(ref err) => Some(&**err),
249250
ConnectError::IoError(ref err) => Some(err),
250-
_ => None
251+
_ => None,
251252
}
252253
}
253254
}
@@ -280,8 +281,8 @@ pub enum ErrorPosition {
280281
/// The byte position.
281282
position: u32,
282283
/// A query generated by the Postgres server.
283-
query: String
284-
}
284+
query: String,
285+
},
285286
}
286287

287288
/// An error encountered when communicating with the Postgres server.
@@ -297,7 +298,7 @@ pub enum Error {
297298
/// An attempt was made to read from a column that does not exist.
298299
InvalidColumn,
299300
/// An error converting between Postgres and Rust types.
300-
Conversion(Box<error::Error+Sync+Send>),
301+
Conversion(Box<error::Error + Sync + Send>),
301302
}
302303

303304
impl fmt::Display for Error {
@@ -329,7 +330,7 @@ impl error::Error for Error {
329330
Error::DbError(ref err) => Some(&**err),
330331
Error::IoError(ref err) => Some(err),
331332
Error::Conversion(ref err) => Some(&**err),
332-
_ => None
333+
_ => None,
333334
}
334335
}
335336
}

src/io/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ pub trait NegotiateSsl {
2626
///
2727
/// The host portion of the connection parameters is provided for hostname
2828
/// verification.
29-
fn negotiate_ssl(&self, host: &str, stream: Stream)
30-
-> Result<Box<StreamWrapper>, Box<Error+Sync+Send>>;
29+
fn negotiate_ssl(&self,
30+
host: &str,
31+
stream: Stream)
32+
-> Result<Box<StreamWrapper>, Box<Error + Sync + Send>>;
3133
}

src/io/openssl.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ impl StreamWrapper for SslStream<Stream> {
1616
}
1717

1818
impl NegotiateSsl for SslContext {
19-
fn negotiate_ssl(&self, _: &str, stream: Stream)
20-
-> Result<Box<StreamWrapper>, Box<Error+Send+Sync>> {
19+
fn negotiate_ssl(&self,
20+
_: &str,
21+
stream: Stream)
22+
-> Result<Box<StreamWrapper>, Box<Error + Send + Sync>> {
2123
let stream = try!(SslStream::connect(self, stream));
2224
Ok(Box::new(stream))
2325
}

0 commit comments

Comments
 (0)