From 4c90977cb0a01bbf2844f51c4c670ebe55d8f87c Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 24 Jan 2015 10:04:43 -0800 Subject: [PATCH] Little cleanup --- src/lib.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 712347c2..8fec89f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1479,23 +1479,23 @@ impl<'conn> Statement<'conn> { self.next_portal_id.set(id + 1); let portal_name = format!("{}p{}", self.name, id); - match self.inner_query(&*portal_name, row_limit, params) { - Ok((result, more_rows)) => { - Ok(LazyRows { - _trans: trans, - result: result, - name: portal_name, - row_limit: row_limit, - more_rows: more_rows, - finished: false, - }) + self.inner_query(&*portal_name, row_limit, params).map(move |(result, more_rows)| { + LazyRows { + _trans: trans, + result: result, + name: portal_name, + row_limit: row_limit, + more_rows: more_rows, + finished: false, } - Err(err) => Err(err), - } + }) } /// Consumes the statement, clearing it from the Postgres session. /// + /// If this statement was created via the `prepare_cached` method, `finish` + /// does nothing. + /// /// Functionally identical to the `Drop` implementation of the /// `Statement` except that it returns any error to the caller. pub fn finish(mut self) -> Result<()> {