Skip to content

Commit f0c7895

Browse files
authored
Merge pull request #11208 from Turbo87/edition
Migrate subcrates to Rust Edition 2024
2 parents 8f1d3df + 2793e74 commit f0c7895

File tree

39 files changed

+97
-90
lines changed

39 files changed

+97
-90
lines changed

crates/crates_io_cdn_logs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "crates_io_cdn_logs"
33
version = "0.0.0"
44
license = "MIT OR Apache-2.0"
5-
edition = "2021"
5+
edition = "2024"
66

77
[lints]
88
workspace = true

crates/crates_io_cdn_logs/benches/count_downloads.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crates_io_cdn_logs::{cloudfront, fastly};
2-
use criterion::{criterion_group, criterion_main, Criterion};
2+
use criterion::{Criterion, criterion_group, criterion_main};
33
use std::hint::black_box;
44
use std::io::Cursor;
55

crates/crates_io_cdn_logs/examples/count_downloads.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use anyhow::Context;
22
use clap::Parser;
3-
use crates_io_cdn_logs::{count_downloads, Decompressor};
3+
use crates_io_cdn_logs::{Decompressor, count_downloads};
44
use std::path::PathBuf;
55
use tokio::fs::File;
66
use tokio::io::BufReader;
77
use tracing::level_filters::LevelFilter;
8-
use tracing_subscriber::{fmt, EnvFilter};
8+
use tracing_subscriber::{EnvFilter, fmt};
99

1010
#[derive(Debug, clap::Parser)]
1111
struct Options {

crates/crates_io_cdn_logs/src/cloudfront.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//! see <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html#LogFileFormat>
44
//! and <https://www.w3.org/TR/WD-logfile.html>.
55
6-
use crate::paths::parse_path;
76
use crate::DownloadsMap;
7+
use crate::paths::parse_path;
88
use chrono::NaiveDate;
99
use std::borrow::Cow;
1010
use tokio::io::{AsyncBufRead, AsyncBufReadExt};

crates/crates_io_cdn_logs/src/fastly/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
mod json;
66

7-
use crate::paths::parse_path;
87
use crate::DownloadsMap;
8+
use crate::paths::parse_path;
99
use std::borrow::Cow;
1010
use tokio::io::{AsyncBufRead, AsyncBufReadExt};
1111
use tracing::{debug_span, instrument, warn};

crates/crates_io_database/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "crates_io_database"
33
version = "0.0.0"
44
license = "MIT OR Apache-2.0"
5-
edition = "2021"
5+
edition = "2024"
66

77
[lints]
88
workspace = true

crates/crates_io_database/src/models/category.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ use diesel::dsl;
55
use diesel::prelude::*;
66
use diesel_async::scoped_futures::ScopedFutureExt;
77
use diesel_async::{AsyncConnection, AsyncPgConnection, RunQueryDsl};
8-
use futures_util::future::BoxFuture;
98
use futures_util::FutureExt;
10-
use std::future::Future;
9+
use futures_util::future::BoxFuture;
1110

1211
#[derive(Clone, Identifiable, Queryable, QueryableByName, Debug, Selectable)]
1312
#[diesel(table_name = categories, check_for_backend(diesel::pg::Pg))]
@@ -97,12 +96,12 @@ impl Category {
9796
.await
9897
}
9998

100-
pub fn toplevel(
99+
pub fn toplevel<'a>(
101100
conn: &mut AsyncPgConnection,
102-
sort: &str,
101+
sort: &'a str,
103102
limit: i64,
104103
offset: i64,
105-
) -> impl Future<Output = QueryResult<Vec<Category>>> {
104+
) -> BoxFuture<'a, QueryResult<Vec<Category>>> {
106105
use diesel::sql_types::Int8;
107106

108107
let sort_sql = match sort {
@@ -116,6 +115,7 @@ impl Category {
116115
.bind::<Int8, _>(limit)
117116
.bind::<Int8, _>(offset)
118117
.load(conn)
118+
.boxed()
119119
}
120120

121121
pub fn subcategories(

crates/crates_io_database/src/models/token.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ mod tests {
145145
};
146146
let json = serde_json::to_string(&tok).unwrap();
147147
assert_some!(json.as_str().find(r#""created_at":"2017-01-06T14:23:11Z""#));
148-
assert_some!(json
149-
.as_str()
150-
.find(r#""last_used_at":"2017-01-06T14:23:12Z""#));
148+
assert_some!(
149+
json.as_str()
150+
.find(r#""last_used_at":"2017-01-06T14:23:12Z""#)
151+
);
151152
}
152153
}

crates/crates_io_database_dump/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "crates_io_database_dump"
33
version = "0.0.0"
44
license = "MIT OR Apache-2.0"
5-
edition = "2021"
5+
edition = "2024"
66

77
[lints]
88
workspace = true

crates/crates_io_database_dump/src/configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl VisibilityConfig {
5353
}
5454
let mut ready: VecDeque<&str> = num_deps
5555
.iter()
56-
.filter(|(_, &count)| count == 0)
56+
.filter(|&(_, &count)| count == 0)
5757
.map(|(&table, _)| table)
5858
.collect();
5959
let mut result = Vec::with_capacity(ready.len());

0 commit comments

Comments
 (0)