Skip to content

Commit 53f342a

Browse files
committed
Fixes for Rust changes
1 parent e50bbd5 commit 53f342a

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/postgres/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ impl<'self> Iterator<PostgresRow<'self>> for PostgresResult<'self> {
10841084
self.execute();
10851085
}
10861086

1087-
do self.data.pop_front().map_move |row| {
1087+
do self.data.pop_front().map |row| {
10881088
PostgresRow {
10891089
stmt: self.stmt,
10901090
data: row

src/postgres/test.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ fn test_custom_notice_handler() {
412412

413413
#[test]
414414
fn test_plaintext_pass() {
415-
PostgresConnection::connect("postgres://pass_user:password@localhost");
415+
PostgresConnection::connect("postgres://pass_user:password@localhost/postgres");
416416
}
417417

418418
#[test]
419419
fn test_plaintext_pass_no_pass() {
420-
let ret = PostgresConnection::try_connect("postgres://pass_user@localhost");
420+
let ret = PostgresConnection::try_connect("postgres://pass_user@localhost/postgres");
421421
match ret {
422422
Err(MissingPassword) => (),
423423
Err(err) => fail2!("Unexpected error {}", err.to_str()),
@@ -427,7 +427,7 @@ fn test_plaintext_pass_no_pass() {
427427

428428
#[test]
429429
fn test_plaintext_pass_wrong_pass() {
430-
let ret = PostgresConnection::try_connect("postgres://pass_user:asdf@localhost");
430+
let ret = PostgresConnection::try_connect("postgres://pass_user:asdf@localhost/postgres");
431431
match ret {
432432
Err(DbError(PostgresDbError { code: InvalidPassword, _ })) => (),
433433
Err(err) => fail2!("Unexpected error {}", err.to_str()),
@@ -437,12 +437,12 @@ fn test_plaintext_pass_wrong_pass() {
437437

438438
#[test]
439439
fn test_md5_pass() {
440-
PostgresConnection::connect("postgres://md5_user:password@localhost");
440+
PostgresConnection::connect("postgres://md5_user:password@localhost/postgres");
441441
}
442442

443443
#[test]
444444
fn test_md5_pass_no_pass() {
445-
let ret = PostgresConnection::try_connect("postgres://md5_user@localhost");
445+
let ret = PostgresConnection::try_connect("postgres://md5_user@localhost/postgres");
446446
match ret {
447447
Err(MissingPassword) => (),
448448
Err(err) => fail2!("Unexpected error {}", err.to_str()),
@@ -452,7 +452,7 @@ fn test_md5_pass_no_pass() {
452452

453453
#[test]
454454
fn test_md5_pass_wrong_pass() {
455-
let ret = PostgresConnection::try_connect("postgres://md5_user:asdf@localhost");
455+
let ret = PostgresConnection::try_connect("postgres://md5_user:asdf@localhost/postgres");
456456
match ret {
457457
Err(DbError(PostgresDbError { code: InvalidPassword, _ })) => (),
458458
Err(err) => fail2!("Unexpected error {}", err.to_str()),

src/postgres/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ macro_rules! from_map_impl(
136136
impl FromSql for Option<$t> {
137137
fn from_sql(ty: PostgresType, raw: &Option<~[u8]>) -> Option<$t> {
138138
check_types!($($expected)|+, ty)
139-
raw.map($blk)
139+
raw.as_ref().map($blk)
140140
}
141141
}
142142
)

travis/setup.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
CREATE ROLE pass_user PASSWORD 'password' LOGIN;
22
CREATE ROLE md5_user PASSWORD 'password' LOGIN;
3-
CREATE DATABASE pass_user OWNER pass_user;
4-
CREATE DATABASE md5_user OWNER md5_user;

0 commit comments

Comments
 (0)