@@ -47,8 +47,7 @@ impl<'a> Transaction<'a> {
4747 where
4848 T : ?Sized + ToStatement ,
4949 {
50- let statement = query. __statement ( self ) ?;
51- executor:: block_on ( self . 0 . execute ( & statement, params) )
50+ executor:: block_on ( self . 0 . execute ( query, params) )
5251 }
5352
5453 /// Like `Client::query`.
@@ -60,16 +59,15 @@ impl<'a> Transaction<'a> {
6059 }
6160
6261 /// Like `Client::query_iter`.
63- pub fn query_iter < T > (
64- & mut self ,
65- query : & T ,
66- params : & [ & ( dyn ToSql + Sync ) ] ,
67- ) -> Result < impl FallibleIterator < Item = Row , Error = Error > , Error >
62+ pub fn query_iter < ' b , T > (
63+ & ' b mut self ,
64+ query : & ' b T ,
65+ params : & ' b [ & ( dyn ToSql + Sync ) ] ,
66+ ) -> Result < impl FallibleIterator < Item = Row , Error = Error > + ' b , Error >
6867 where
6968 T : ?Sized + ToStatement ,
7069 {
71- let statement = query. __statement ( self ) ?;
72- Ok ( Iter :: new ( self . 0 . query ( & statement, params) ) )
70+ Ok ( Iter :: new ( self . 0 . query ( query, params) ) )
7371 }
7472
7573 /// Binds parameters to a statement, creating a "portal".
@@ -86,8 +84,7 @@ impl<'a> Transaction<'a> {
8684 where
8785 T : ?Sized + ToStatement ,
8886 {
89- let statement = query. __statement ( self ) ?;
90- executor:: block_on ( self . 0 . bind ( & statement, params) )
87+ executor:: block_on ( self . 0 . bind ( query, params) )
9188 }
9289
9390 /// Continues execution of a portal, returning the next set of rows.
@@ -100,11 +97,11 @@ impl<'a> Transaction<'a> {
10097
10198 /// Like `query_portal`, except that it returns a fallible iterator over the resulting rows rather than buffering
10299 /// the entire response in memory.
103- pub fn query_portal_iter (
104- & mut self ,
105- portal : & Portal ,
100+ pub fn query_portal_iter < ' b > (
101+ & ' b mut self ,
102+ portal : & ' b Portal ,
106103 max_rows : i32 ,
107- ) -> Result < impl FallibleIterator < Item = Row , Error = Error > , Error > {
104+ ) -> Result < impl FallibleIterator < Item = Row , Error = Error > + ' b , Error > {
108105 Ok ( Iter :: new ( self . 0 . query_portal ( & portal, max_rows) ) )
109106 }
110107
@@ -119,21 +116,19 @@ impl<'a> Transaction<'a> {
119116 T : ?Sized + ToStatement ,
120117 R : Read + Unpin ,
121118 {
122- let statement = query. __statement ( self ) ?;
123- executor:: block_on ( self . 0 . copy_in ( & statement, params, CopyInStream ( reader) ) )
119+ executor:: block_on ( self . 0 . copy_in ( query, params, CopyInStream ( reader) ) )
124120 }
125121
126122 /// Like `Client::copy_out`.
127123 pub fn copy_out < ' b , T > (
128- & ' a mut self ,
129- query : & T ,
130- params : & [ & ( dyn ToSql + Sync ) ] ,
124+ & ' b mut self ,
125+ query : & ' b T ,
126+ params : & ' b [ & ( dyn ToSql + Sync ) ] ,
131127 ) -> Result < impl BufRead + ' b , Error >
132128 where
133129 T : ?Sized + ToStatement ,
134130 {
135- let statement = query. __statement ( self ) ?;
136- let stream = self . 0 . copy_out ( & statement, params) ;
131+ let stream = self . 0 . copy_out ( query, params) ;
137132 CopyOutReader :: new ( stream)
138133 }
139134
@@ -145,7 +140,7 @@ impl<'a> Transaction<'a> {
145140 /// Like `Client::simple_query_iter`.
146141 pub fn simple_query_iter < ' b > (
147142 & ' b mut self ,
148- query : & str ,
143+ query : & ' b str ,
149144 ) -> Result < impl FallibleIterator < Item = SimpleQueryMessage , Error = Error > + ' b , Error > {
150145 Ok ( Iter :: new ( self . 0 . simple_query ( query) ) )
151146 }
0 commit comments