Skip to content

Commit 521a8d0

Browse files
committed
Specify precise capturing where needed
This prepares for moving to Rust Edition 2024 where these will be mandatory.
1 parent 8509205 commit 521a8d0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/controllers/summary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct Record {
142142
fn encode_crates(
143143
conn: &mut AsyncPgConnection,
144144
data: Vec<Record>,
145-
) -> impl Future<Output = AppResult<Vec<EncodableCrate>>> {
145+
) -> impl Future<Output = AppResult<Vec<EncodableCrate>>> + use<> {
146146
let crate_ids = data
147147
.iter()
148148
.map(|record| record.krate.id)

src/worker/jobs/rss/sync_crate_feed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ mod tests {
247247
.unwrap()
248248
}
249249

250-
fn create_version(
250+
fn create_version<T: Into<Cow<'static, str>>>(
251251
conn: &mut AsyncPgConnection,
252252
crate_id: i32,
253-
version: impl Into<Cow<'static, str>>,
253+
version: T,
254254
publish_time: DateTime<Utc>,
255-
) -> impl Future<Output = i32> {
255+
) -> impl Future<Output = i32> + use<T> {
256256
let version = version.into();
257257
let future = diesel::insert_into(versions::table)
258258
.values((

src/worker/jobs/rss/sync_crates_feed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ mod tests {
211211
assert_debug_snapshot!(new_crates.iter().map(|u| &u.name).collect::<Vec<_>>());
212212
}
213213

214-
fn create_crate(
214+
fn create_crate<T: Into<Cow<'static, str>>>(
215215
conn: &mut AsyncPgConnection,
216-
name: impl Into<Cow<'static, str>>,
216+
name: T,
217217
publish_time: DateTime<Utc>,
218-
) -> impl Future<Output = i32> {
218+
) -> impl Future<Output = i32> + use<T> {
219219
let future = diesel::insert_into(crates::table)
220220
.values((
221221
crates::name.eq(name.into()),

src/worker/jobs/rss/sync_updates_feed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ mod tests {
237237
.unwrap()
238238
}
239239

240-
fn create_version(
240+
fn create_version<T: Into<Cow<'static, str>>>(
241241
conn: &mut AsyncPgConnection,
242242
crate_id: i32,
243-
version: impl Into<Cow<'static, str>>,
243+
version: T,
244244
publish_time: DateTime<Utc>,
245-
) -> impl Future<Output = i32> {
245+
) -> impl Future<Output = i32> + use<T> {
246246
let version = version.into();
247247
let future = diesel::insert_into(versions::table)
248248
.values((

0 commit comments

Comments
 (0)