diff --git a/postgres/src/lib.rs b/postgres/src/lib.rs index a860bc01..cd332579 100644 --- a/postgres/src/lib.rs +++ b/postgres/src/lib.rs @@ -1156,7 +1156,7 @@ impl Connection { /// println!("foo: {}", foo); /// } /// ``` - pub fn query(&self, query: &str, params: &[&ToSql]) -> Result> { + pub fn query(&self, query: &str, params: &[&ToSql]) -> Result { let (param_types, columns) = self.0.borrow_mut().raw_prepare("", query)?; let info = Arc::new(StatementInfo { name: String::new(), @@ -1376,7 +1376,7 @@ pub trait GenericConnection { fn execute(&self, query: &str, params: &[&ToSql]) -> Result; /// Like `Connection::query`. - fn query<'a>(&'a self, query: &str, params: &[&ToSql]) -> Result>; + fn query<'a>(&'a self, query: &str, params: &[&ToSql]) -> Result; /// Like `Connection::prepare`. fn prepare<'a>(&'a self, query: &str) -> Result>; @@ -1399,7 +1399,7 @@ impl GenericConnection for Connection { self.execute(query, params) } - fn query<'a>(&'a self, query: &str, params: &[&ToSql]) -> Result> { + fn query<'a>(&'a self, query: &str, params: &[&ToSql]) -> Result { self.query(query, params) } @@ -1429,7 +1429,7 @@ impl<'a> GenericConnection for Transaction<'a> { self.execute(query, params) } - fn query<'b>(&'b self, query: &str, params: &[&ToSql]) -> Result> { + fn query<'b>(&'b self, query: &str, params: &[&ToSql]) -> Result { self.query(query, params) } diff --git a/postgres/src/rows.rs b/postgres/src/rows.rs index b6073d81..730aa99f 100644 --- a/postgres/src/rows.rs +++ b/postgres/src/rows.rs @@ -10,7 +10,6 @@ use std::io; use std::ops::Deref; use std::slice; use std::sync::Arc; -use std::marker::PhantomData; use {Result, StatementInfo}; use transaction::Transaction; @@ -35,14 +34,12 @@ impl<'a, T> Deref for MaybeOwned<'a, T> { } /// The resulting rows of a query. -// FIXME remove lifetime -pub struct Rows<'compat> { +pub struct Rows { stmt_info: Arc, data: Vec, - _marker: PhantomData<&'compat u8>, } -impl<'a> fmt::Debug for Rows<'a> { +impl fmt::Debug for Rows { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("Rows") .field("columns", &self.columns()) @@ -51,17 +48,14 @@ impl<'a> fmt::Debug for Rows<'a> { } } -impl Rows<'static> { - pub(crate) fn new(stmt: &Statement, data: Vec) -> Rows<'static> { +impl Rows { + pub(crate) fn new(stmt: &Statement, data: Vec) -> Rows { Rows { stmt_info: stmt.info().clone(), data: data, - _marker: PhantomData, } } -} -impl<'rows> Rows<'rows> { /// Returns a slice describing the columns of the `Rows`. pub fn columns(&self) -> &[Column] { &self.stmt_info.columns[..] @@ -98,7 +92,7 @@ impl<'rows> Rows<'rows> { } } -impl<'a> IntoIterator for &'a Rows<'a> { +impl<'a> IntoIterator for &'a Rows { type Item = Row<'a>; type IntoIter = Iter<'a>; diff --git a/postgres/src/stmt.rs b/postgres/src/stmt.rs index 5dfb776b..6053c2ce 100644 --- a/postgres/src/stmt.rs +++ b/postgres/src/stmt.rs @@ -58,7 +58,7 @@ impl<'conn> Statement<'conn> { self.conn } - pub(crate) fn into_query(self, params: &[&ToSql]) -> Result> { + pub(crate) fn into_query(self, params: &[&ToSql]) -> Result { check_desync!(self.conn); let mut rows = vec![]; self.inner_query("", 0, params, |row| rows.push(row))?; @@ -210,7 +210,7 @@ impl<'conn> Statement<'conn> { /// println!("foo: {}", foo); /// } /// ``` - pub fn query(&self, params: &[&ToSql]) -> Result> { + pub fn query(&self, params: &[&ToSql]) -> Result { check_desync!(self.conn); let mut rows = vec![]; self.inner_query("", 0, params, |row| rows.push(row))?; diff --git a/postgres/src/transaction.rs b/postgres/src/transaction.rs index 9421cd25..a7935a45 100644 --- a/postgres/src/transaction.rs +++ b/postgres/src/transaction.rs @@ -222,7 +222,7 @@ impl<'conn> Transaction<'conn> { } /// Like `Connection::query`. - pub fn query<'a>(&'a self, query: &str, params: &[&ToSql]) -> Result> { + pub fn query<'a>(&'a self, query: &str, params: &[&ToSql]) -> Result { self.conn.query(query, params) }