Skip to content

Commit df14f86

Browse files
committed
chore(raw_sql): try not adding another lifetime param
1 parent dbbeed2 commit df14f86

File tree

1 file changed

+15
-36
lines changed

1 file changed

+15
-36
lines changed

sqlx-core/src/raw_sql.rs

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -140,28 +140,25 @@ impl<'q, DB: Database> Execute<'q, DB> for RawSql<'q> {
140140
impl<'q> RawSql<'q> {
141141
/// Execute the SQL string and return the total number of rows affected.
142142
#[inline]
143-
pub async fn execute<'e, 'c: 'e, E, DB>(
144-
self,
145-
executor: E,
146-
) -> crate::Result<DB::QueryResult>
143+
pub async fn execute<'e, E, DB>(self, executor: E) -> crate::Result<DB::QueryResult>
147144
where
148145
'q: 'e,
149146
DB: Database,
150-
E: Executor<'c, Database = DB>,
147+
E: Executor<'e, Database = DB>,
151148
{
152149
executor.execute(self).await
153150
}
154151

155152
/// Execute the SQL string. Returns a stream which gives the number of rows affected for each statement in the string.
156153
#[inline]
157-
pub fn execute_many<'e, 'c: 'e, E, DB>(
154+
pub fn execute_many<'e, E, DB>(
158155
self,
159156
executor: E,
160157
) -> BoxStream<'e, crate::Result<DB::QueryResult>>
161158
where
162159
'q: 'e,
163160
DB: Database,
164-
E: Executor<'c, Database = DB>,
161+
E: Executor<'e, Database = DB>,
165162
{
166163
executor.execute_many(self)
167164
}
@@ -170,14 +167,11 @@ impl<'q> RawSql<'q> {
170167
///
171168
/// If the string contains multiple statements, their results will be concatenated together.
172169
#[inline]
173-
pub fn fetch<'e, 'c: 'e, E, DB>(
174-
self,
175-
executor: E,
176-
) -> BoxStream<'e, Result<DB::Row, Error>>
170+
pub fn fetch<'e, E, DB>(self, executor: E) -> BoxStream<'e, Result<DB::Row, Error>>
177171
where
178172
'q: 'e,
179173
DB: Database,
180-
E: Executor<'c, Database = DB>,
174+
E: Executor<'e, Database = DB>,
181175
{
182176
executor.fetch(self)
183177
}
@@ -187,20 +181,14 @@ impl<'q> RawSql<'q> {
187181
/// For each query in the stream, any generated rows are returned first,
188182
/// then the `QueryResult` with the number of rows affected.
189183
#[inline]
190-
pub fn fetch_many<'e, 'c: 'e, E, DB>(
184+
pub fn fetch_many<'e, E, DB>(
191185
self,
192186
executor: E,
193-
) -> BoxStream<
194-
'e,
195-
Result<
196-
Either<DB::QueryResult, DB::Row>,
197-
Error,
198-
>,
199-
>
187+
) -> BoxStream<'e, Result<Either<DB::QueryResult, DB::Row>, Error>>
200188
where
201189
'q: 'e,
202190
DB: Database,
203-
E: Executor<'c, Database = DB>,
191+
E: Executor<'e, Database = DB>,
204192
{
205193
executor.fetch_many(self)
206194
}
@@ -213,14 +201,11 @@ impl<'q> RawSql<'q> {
213201
/// To avoid exhausting available memory, ensure the result set has a known upper bound,
214202
/// e.g. using `LIMIT`.
215203
#[inline]
216-
pub fn fetch_all<'e, 'c: 'e, E, DB>(
217-
self,
218-
executor: E,
219-
) -> BoxFuture<'e, crate::Result<Vec<DB::Row>>>
204+
pub fn fetch_all<'e, E, DB>(self, executor: E) -> BoxFuture<'e, crate::Result<Vec<DB::Row>>>
220205
where
221206
'q: 'e,
222207
DB: Database,
223-
E: Executor<'c, Database = DB>,
208+
E: Executor<'e, Database = DB>,
224209
{
225210
executor.fetch_all(self)
226211
}
@@ -238,14 +223,11 @@ impl<'q> RawSql<'q> {
238223
///
239224
/// Otherwise, you might want to add `LIMIT 1` to your query.
240225
#[inline]
241-
pub fn fetch_one<'e, 'c: 'e, E, DB>(
242-
self,
243-
executor: E,
244-
) -> BoxFuture<'e, crate::Result<DB::Row>>
226+
pub fn fetch_one<'e, E, DB>(self, executor: E) -> BoxFuture<'e, crate::Result<DB::Row>>
245227
where
246228
'q: 'e,
247229
DB: Database,
248-
E: Executor<'c, Database = DB>,
230+
E: Executor<'e, Database = DB>,
249231
{
250232
executor.fetch_one(self)
251233
}
@@ -263,14 +245,11 @@ impl<'q> RawSql<'q> {
263245
///
264246
/// Otherwise, you might want to add `LIMIT 1` to your query.
265247
#[inline]
266-
pub async fn fetch_optional<'e, 'c: 'e, E, DB>(
267-
self,
268-
executor: E,
269-
) -> crate::Result<DB::Row>
248+
pub async fn fetch_optional<'e, E, DB>(self, executor: E) -> crate::Result<DB::Row>
270249
where
271250
'q: 'e,
272251
DB: Database,
273-
E: Executor<'c, Database = DB>,
252+
E: Executor<'e, Database = DB>,
274253
{
275254
executor.fetch_one(self).await
276255
}

0 commit comments

Comments
 (0)