Moving blocks around for consistency

This commit is contained in:
Steven Fackler 2013-08-29 02:19:53 -04:00
parent 440421e81a
commit 543af184ab

View File

@ -43,19 +43,6 @@ fn handle_notice_response(fields: ~[(u8, ~str)]) {
info!("%s: %s", err.severity, err.message);
}
pub struct PostgresConnection {
priv stream: Cell<TcpStream>,
priv next_stmt_id: Cell<int>
}
impl Drop for PostgresConnection {
fn drop(&self) {
do io_error::cond.trap(|_| {}).inside {
self.write_message(&Terminate);
}
}
}
#[deriving(ToStr)]
pub enum PostgresConnectError {
InvalidUrl,
@ -114,6 +101,19 @@ impl PostgresDbError {
}
}
pub struct PostgresConnection {
priv stream: Cell<TcpStream>,
priv next_stmt_id: Cell<int>
}
impl Drop for PostgresConnection {
fn drop(&self) {
do io_error::cond.trap(|_| {}).inside {
self.write_message(&Terminate);
}
}
}
impl PostgresConnection {
pub fn connect(url: &str) -> PostgresConnection {
match PostgresConnection::try_connect(url) {