This commit is contained in:
Steven Fackler 2016-01-02 16:02:34 -08:00
parent 3ddcf87203
commit 278a03ac83
2 changed files with 6 additions and 7 deletions

View File

@ -402,7 +402,8 @@ impl InnerConnection {
let user = match user { let user = match user {
Some(user) => user, Some(user) => user,
None => { None => {
let err: Box<StdError + StdSync + Send> = "User missing from connection parameters".into(); let err: Box<StdError + StdSync + Send> = "User missing from connection parameters"
.into();
return Err(ConnectError::ConnectParams(err)); return Err(ConnectError::ConnectParams(err));
} }
}; };

View File

@ -44,11 +44,7 @@ macro_rules! to_sql_checked {
// WARNING: this function is not considered part of this crate's public API. // WARNING: this function is not considered part of this crate's public API.
// It is subject to change at any time. // It is subject to change at any time.
#[doc(hidden)] #[doc(hidden)]
pub fn __to_sql_checked<T>(v: &T, pub fn __to_sql_checked<T>(v: &T, ty: &Type, out: &mut Write, ctx: &SessionInfo) -> Result<IsNull>
ty: &Type,
out: &mut Write,
ctx: &SessionInfo)
-> Result<IsNull>
where T: ToSql where T: ToSql
{ {
if !T::accepts(ty) { if !T::accepts(ty) {
@ -589,7 +585,9 @@ pub struct WrongType(Type);
impl fmt::Display for WrongType { impl fmt::Display for WrongType {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "cannot convert to or from a Postgres value of type `{}`", self.0) write!(fmt,
"cannot convert to or from a Postgres value of type `{}`",
self.0)
} }
} }