Skip to content

Commit 38b491b

Browse files
committed
Don't consume Statement
1 parent 8b1034a commit 38b491b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

postgres-tokio/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,12 @@ impl Statement {
616616
&self.columns
617617
}
618618

619-
pub fn execute(self,
619+
pub fn execute(&self,
620620
params: &[&ToSql],
621621
conn: Connection)
622-
-> BoxFuture<(u64, Statement, Connection), Error> {
622+
-> BoxFuture<(u64, Connection), Error> {
623623
conn.raw_execute(&self.name, "", &self.params, params)
624624
.and_then(|conn| conn.finish_execute())
625-
.map(|(n, conn)| (n, self, conn))
626625
.boxed()
627626
}
628627
}

postgres-tokio/src/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ fn prepare_execute() {
113113
c.unwrap().prepare("CREATE TEMPORARY TABLE foo (id SERIAL PRIMARY KEY, name VARCHAR)")
114114
})
115115
.and_then(|(s, c)| s.execute(&[], c))
116-
.and_then(|(n, _, c)| {
116+
.and_then(|(n, c)| {
117117
assert_eq!(0, n);
118118
c.prepare("INSERT INTO foo (name) VALUES ($1), ($2)")
119119
})
120120
.and_then(|(s, c)| s.execute(&[&"steven", &"bob"], c))
121-
.map(|(n, _, _)| assert_eq!(n, 2));
121+
.map(|(n, _)| assert_eq!(n, 2));
122122
l.run(done).unwrap();
123123
}

0 commit comments

Comments
 (0)