Refactor: Extract ToSql into its own module.

This commit is contained in:
John Gallagher
2016-05-22 20:16:54 -04:00
parent 0e96e2269c
commit dccfd7e801
4 changed files with 109 additions and 95 deletions

View File

@@ -882,7 +882,12 @@ impl<'conn> Statement<'conn> {
for (i, p) in params.iter().enumerate() {
try!(unsafe {
self.conn.decode_result(p.bind_parameter(self.stmt.ptr(), (i + 1) as c_int))
self.conn.decode_result(
// This should be
// `p.bind_parameter(self.stmt.ptr(), (i + 1) as c_int)`
// but that doesn't compile until Rust 1.9 due to a compiler bug.
ToSql::bind_parameter(*p, self.stmt.ptr(), (i + 1) as c_int)
)
});
}