Fixes for Rust changes

This commit is contained in:
Steven Fackler 2013-10-10 20:50:39 -07:00
parent e50bbd5d5c
commit 53f342a53a
4 changed files with 8 additions and 10 deletions

View File

@ -1084,7 +1084,7 @@ impl<'self> Iterator<PostgresRow<'self>> for PostgresResult<'self> {
self.execute();
}
do self.data.pop_front().map_move |row| {
do self.data.pop_front().map |row| {
PostgresRow {
stmt: self.stmt,
data: row

View File

@ -412,12 +412,12 @@ fn test_custom_notice_handler() {
#[test]
fn test_plaintext_pass() {
PostgresConnection::connect("postgres://pass_user:password@localhost");
PostgresConnection::connect("postgres://pass_user:password@localhost/postgres");
}
#[test]
fn test_plaintext_pass_no_pass() {
let ret = PostgresConnection::try_connect("postgres://pass_user@localhost");
let ret = PostgresConnection::try_connect("postgres://pass_user@localhost/postgres");
match ret {
Err(MissingPassword) => (),
Err(err) => fail2!("Unexpected error {}", err.to_str()),
@ -427,7 +427,7 @@ fn test_plaintext_pass_no_pass() {
#[test]
fn test_plaintext_pass_wrong_pass() {
let ret = PostgresConnection::try_connect("postgres://pass_user:asdf@localhost");
let ret = PostgresConnection::try_connect("postgres://pass_user:asdf@localhost/postgres");
match ret {
Err(DbError(PostgresDbError { code: InvalidPassword, _ })) => (),
Err(err) => fail2!("Unexpected error {}", err.to_str()),
@ -437,12 +437,12 @@ fn test_plaintext_pass_wrong_pass() {
#[test]
fn test_md5_pass() {
PostgresConnection::connect("postgres://md5_user:password@localhost");
PostgresConnection::connect("postgres://md5_user:password@localhost/postgres");
}
#[test]
fn test_md5_pass_no_pass() {
let ret = PostgresConnection::try_connect("postgres://md5_user@localhost");
let ret = PostgresConnection::try_connect("postgres://md5_user@localhost/postgres");
match ret {
Err(MissingPassword) => (),
Err(err) => fail2!("Unexpected error {}", err.to_str()),
@ -452,7 +452,7 @@ fn test_md5_pass_no_pass() {
#[test]
fn test_md5_pass_wrong_pass() {
let ret = PostgresConnection::try_connect("postgres://md5_user:asdf@localhost");
let ret = PostgresConnection::try_connect("postgres://md5_user:asdf@localhost/postgres");
match ret {
Err(DbError(PostgresDbError { code: InvalidPassword, _ })) => (),
Err(err) => fail2!("Unexpected error {}", err.to_str()),

View File

@ -136,7 +136,7 @@ macro_rules! from_map_impl(
impl FromSql for Option<$t> {
fn from_sql(ty: PostgresType, raw: &Option<~[u8]>) -> Option<$t> {
check_types!($($expected)|+, ty)
raw.map($blk)
raw.as_ref().map($blk)
}
}
)

View File

@ -1,4 +1,2 @@
CREATE ROLE pass_user PASSWORD 'password' LOGIN;
CREATE ROLE md5_user PASSWORD 'password' LOGIN;
CREATE DATABASE pass_user OWNER pass_user;
CREATE DATABASE md5_user OWNER md5_user;