@@ -208,10 +208,10 @@ pub struct PostgresCancelData {
208208/// `PostgresConnection::cancel_data`. The object can cancel any query made on
209209/// that connection.
210210pub fn cancel_query ( url : & str , ssl : & SslMode , data : PostgresCancelData )
211- -> Option < PostgresConnectError > {
211+ -> Result < ( ) , PostgresConnectError > {
212212 let Url { host, port, .. } : Url = match FromStr :: from_str ( url) {
213213 Some ( url) => url,
214- None => return Some ( InvalidUrl )
214+ None => return Err ( InvalidUrl )
215215 } ;
216216 let port = match port {
217217 Some ( port) => FromStr :: from_str ( port) . unwrap ( ) ,
@@ -220,7 +220,7 @@ pub fn cancel_query(url: &str, ssl: &SslMode, data: PostgresCancelData)
220220
221221 let mut socket = match initialize_stream ( host, port, ssl) {
222222 Ok ( socket) => socket,
223- Err ( err) => return Some ( err)
223+ Err ( err) => return Err ( err)
224224 } ;
225225
226226 socket. write_message ( & CancelRequest {
@@ -230,7 +230,7 @@ pub fn cancel_query(url: &str, ssl: &SslMode, data: PostgresCancelData)
230230 } ) ;
231231 socket. flush ( ) ;
232232
233- None
233+ Ok ( ( ) )
234234}
235235
236236fn open_socket ( host : & str , port : Port )
@@ -325,7 +325,7 @@ impl Writer for InternalStream {
325325
326326struct InnerPostgresConnection {
327327 stream : BufferedStream < InternalStream > ,
328- next_stmt_id : int ,
328+ next_stmt_id : uint ,
329329 notice_handler : ~PostgresNoticeHandler ,
330330 notifications : RingBuf < PostgresNotification > ,
331331 cancel_data : PostgresCancelData ,
@@ -347,7 +347,7 @@ impl InnerPostgresConnection {
347347 host,
348348 port,
349349 user,
350- path,
350+ path : mut path ,
351351 query : mut args,
352352 ..
353353 } : Url = match FromStr :: from_str ( url) {
@@ -387,7 +387,8 @@ impl InnerPostgresConnection {
387387 args. push ( ( ~"user", user. user . clone ( ) ) ) ;
388388 if !path. is_empty ( ) {
389389 // path contains the leading /
390- args. push ( ( ~"database", path. slice_from ( 1 ) . to_owned ( ) ) ) ;
390+ path. shift_char ( ) ;
391+ args. push ( ( ~"database", path) ) ;
391392 }
392393 conn. write_messages ( [ StartupMessage {
393394 version : message:: PROTOCOL_VERSION ,
0 commit comments