Moving blocks around for consistency
This commit is contained in:
parent
440421e81a
commit
543af184ab
26
src/lib.rs
26
src/lib.rs
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user