Upgrade for upstream changes
This commit is contained in:
parent
7849a5843d
commit
3a01ffba83
42
src/error.rs
42
src/error.rs
@ -382,23 +382,23 @@ pub enum PostgresConnectError {
|
|||||||
impl fmt::Show for PostgresConnectError {
|
impl fmt::Show for PostgresConnectError {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
InvalidUrl(ref err) => write!(fmt.buf, "Invalid URL: {}", err),
|
InvalidUrl(ref err) => write!(fmt, "Invalid URL: {}", err),
|
||||||
MissingUser => fmt.buf.write_str("User missing in URL"),
|
MissingUser => write!(fmt, "User missing in URL"),
|
||||||
SocketError(ref err) =>
|
SocketError(ref err) =>
|
||||||
write!(fmt.buf, "Unable to open connection to server: {}", err),
|
write!(fmt, "Unable to open connection to server: {}", err),
|
||||||
PgConnectDbError(ref err) => err.fmt(fmt),
|
PgConnectDbError(ref err) => err.fmt(fmt),
|
||||||
MissingPassword =>
|
MissingPassword =>
|
||||||
fmt.buf.write_str("The server requested a password but none \
|
write!(fmt, "The server requested a password but none was \
|
||||||
was provided"),
|
provided"),
|
||||||
UnsupportedAuthentication =>
|
UnsupportedAuthentication =>
|
||||||
fmt.buf.write_str("The server requested an unsupporeted \
|
write!(fmt, "The server requested an unsupported \
|
||||||
authentication method"),
|
authentication method"),
|
||||||
NoSslSupport =>
|
NoSslSupport =>
|
||||||
fmt.buf.write_str("The server does not support SSL"),
|
write!(fmt, "The server does not support SSL"),
|
||||||
SslError(ref err) =>
|
SslError(ref err) =>
|
||||||
write!(fmt.buf, "Error initiating SSL session: {}", err),
|
write!(fmt, "Error initiating SSL session: {}", err),
|
||||||
PgConnectStreamError(ref err) =>
|
PgConnectStreamError(ref err) =>
|
||||||
write!(fmt.buf, "Error communicating with server: {}", err),
|
write!(fmt, "Error communicating with server: {}", err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -506,7 +506,7 @@ impl PostgresDbError {
|
|||||||
|
|
||||||
impl fmt::Show for PostgresDbError {
|
impl fmt::Show for PostgresDbError {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(fmt.buf, "{}: {}", self.severity, self.message)
|
write!(fmt, "{}: {}", self.severity, self.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,18 +542,18 @@ impl fmt::Show for PostgresError {
|
|||||||
match *self {
|
match *self {
|
||||||
PgDbError(ref err) => err.fmt(fmt),
|
PgDbError(ref err) => err.fmt(fmt),
|
||||||
PgStreamError(ref err) => err.fmt(fmt),
|
PgStreamError(ref err) => err.fmt(fmt),
|
||||||
PgStreamDesynchronized => fmt.buf.write_str(
|
PgStreamDesynchronized =>
|
||||||
"Communication with the server has desynchronized due to an \
|
write!(fmt, "Communication with the server has desynchronized \
|
||||||
earlier IO error"),
|
due to an earlier IO error"),
|
||||||
PgWrongConnection => fmt.buf.write_str(
|
PgWrongConnection =>
|
||||||
"A statement was executed with a connection it was not \
|
write!(fmt, "A statement was executed with a connection it was \
|
||||||
prepared with"),
|
not prepared with"),
|
||||||
PgWrongParamCount { expected, actual } =>
|
PgWrongParamCount { expected, actual } =>
|
||||||
write!(fmt.buf, "Expected {} parameters but got {}", expected,
|
write!(fmt, "Expected {} parameters but got {}", expected,
|
||||||
actual),
|
actual),
|
||||||
PgWrongType(ref ty) => write!(fmt.buf, "Unexpected type {}", ty),
|
PgWrongType(ref ty) => write!(fmt, "Unexpected type {}", ty),
|
||||||
PgInvalidColumn => fmt.buf.write_str("Invalid column"),
|
PgInvalidColumn => write!(fmt, "Invalid column"),
|
||||||
PgWasNull => fmt.buf.write_str("The value was NULL")
|
PgWasNull => write!(fmt, "The value was NULL"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,10 +192,10 @@ impl<S: BoundSided, T: fmt::Show> fmt::Show for RangeBound<S, T> {
|
|||||||
|
|
||||||
match BoundSided::side(None::<S>) {
|
match BoundSided::side(None::<S>) {
|
||||||
Lower => {
|
Lower => {
|
||||||
write!(fmt.buf, "{}{}", chars[0], self.value)
|
write!(fmt, "{}{}", chars[0], self.value)
|
||||||
}
|
}
|
||||||
Upper => {
|
Upper => {
|
||||||
write!(fmt.buf, "{}{}", self.value, chars[1])
|
write!(fmt, "{}{}", self.value, chars[1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,16 +270,16 @@ enum InnerRange<T> {
|
|||||||
impl<T: fmt::Show> fmt::Show for Range<T> {
|
impl<T: fmt::Show> fmt::Show for Range<T> {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self.inner {
|
match self.inner {
|
||||||
Empty => fmt.buf.write_str("empty"),
|
Empty => write!(fmt, "empty"),
|
||||||
Normal(ref lower, ref upper) => {
|
Normal(ref lower, ref upper) => {
|
||||||
match *lower {
|
match *lower {
|
||||||
Some(ref bound) => try!(bound.fmt(fmt)),
|
Some(ref bound) => try!(bound.fmt(fmt)),
|
||||||
None => try!(fmt.buf.write_char('(')),
|
None => try!(write!(fmt, "(")),
|
||||||
}
|
}
|
||||||
try!(fmt.buf.write_char(','));
|
try!(write!(fmt, ","));
|
||||||
match *upper {
|
match *upper {
|
||||||
Some(ref bound) => bound.fmt(fmt),
|
Some(ref bound) => bound.fmt(fmt),
|
||||||
None => fmt.buf.write_char(')'),
|
None => write!(fmt, ")"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit dd6289bbdaae6385063d7b967df53076cfef320d
|
Subproject commit 2e49a8024cf7206638c0f56ed29871db9357bd12
|
Loading…
Reference in New Issue
Block a user