From f242bc6df88ff873076bc24ac647de30e541b19c Mon Sep 17 00:00:00 2001 From: Starnick4444 Date: Tue, 1 Jul 2025 08:28:28 +0200 Subject: [PATCH] chore(contrib): upgrade to 2024 edition Part of #114 This edition change doesn't affect these crates except for formatting. Change-Id: I441c967b6803f1f839379c2ec13dee3f0958fb05 Reviewed-on: https://cl.snix.dev/c/snix/+/30593 Autosubmit: Bence Nemes Reviewed-by: Ilan Joselevich Reviewed-by: Florian Klink Tested-by: besadii --- contrib/crunch-v2/Cargo.nix | 2 +- contrib/crunch-v2/Cargo.toml | 2 +- contrib/crunch-v2/rustfmt.toml | 1 + contrib/crunch-v2/src/bin/extract.rs | 4 ++-- contrib/crunch-v2/src/main.rs | 4 ++-- contrib/crunch-v2/src/remote.rs | 8 ++++---- contrib/fetchroots/Cargo.nix | 2 +- contrib/fetchroots/Cargo.toml | 2 +- contrib/fetchroots/rustfmt.toml | 1 + contrib/fetchroots/src/main.rs | 2 +- contrib/narinfo2parquet/Cargo.nix | 2 +- contrib/narinfo2parquet/Cargo.toml | 2 +- contrib/narinfo2parquet/rustfmt.toml | 1 + contrib/narinfo2parquet/src/main.rs | 2 +- contrib/snixbolt/Cargo.nix | 2 +- contrib/snixbolt/Cargo.toml | 2 +- contrib/snixbolt/rustfmt.toml | 1 + contrib/snixbolt/src/lib.rs | 2 +- contrib/turbofetch/Cargo.nix | 2 +- contrib/turbofetch/Cargo.toml | 2 +- contrib/turbofetch/rustfmt.toml | 1 + contrib/turbofetch/src/main.rs | 6 +++--- contrib/weave/Cargo.nix | 2 +- contrib/weave/Cargo.toml | 2 +- contrib/weave/rustfmt.toml | 1 + contrib/weave/src/bin/swizzle.rs | 4 ++-- contrib/weave/src/main.rs | 4 ++-- 27 files changed, 36 insertions(+), 30 deletions(-) create mode 100644 contrib/crunch-v2/rustfmt.toml create mode 100644 contrib/fetchroots/rustfmt.toml create mode 100644 contrib/narinfo2parquet/rustfmt.toml create mode 100644 contrib/snixbolt/rustfmt.toml create mode 100644 contrib/turbofetch/rustfmt.toml create mode 100644 contrib/weave/rustfmt.toml diff --git a/contrib/crunch-v2/Cargo.nix b/contrib/crunch-v2/Cargo.nix index 6f38f058f..4af5be5a3 100644 --- a/contrib/crunch-v2/Cargo.nix +++ b/contrib/crunch-v2/Cargo.nix @@ -1581,7 +1581,7 @@ rec { "crunch-v2" = rec { crateName = "crunch-v2"; version = "0.1.0"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "crunch-v2"; diff --git a/contrib/crunch-v2/Cargo.toml b/contrib/crunch-v2/Cargo.toml index 763c7e85d..e0159afd9 100644 --- a/contrib/crunch-v2/Cargo.toml +++ b/contrib/crunch-v2/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "crunch-v2" version = "0.1.0" -edition = "2021" +edition = "2024" [workspace] members = ["."] diff --git a/contrib/crunch-v2/rustfmt.toml b/contrib/crunch-v2/rustfmt.toml new file mode 100644 index 000000000..f216078d9 --- /dev/null +++ b/contrib/crunch-v2/rustfmt.toml @@ -0,0 +1 @@ +edition = "2024" diff --git a/contrib/crunch-v2/src/bin/extract.rs b/contrib/crunch-v2/src/bin/extract.rs index 416d201f4..066c17f0d 100644 --- a/contrib/crunch-v2/src/bin/extract.rs +++ b/contrib/crunch-v2/src/bin/extract.rs @@ -16,8 +16,8 @@ use prost::Message; use polars::{ chunked_array::builder::AnonymousOwnedListBuilder, prelude::{ - df, BinaryChunkedBuilder, ChunkedBuilder, DataFrame, DataType, Field, ListBuilderTrait, - NamedFrom, ParquetWriter, PrimitiveChunkedBuilder, Series, UInt32Type, + BinaryChunkedBuilder, ChunkedBuilder, DataFrame, DataType, Field, ListBuilderTrait, + NamedFrom, ParquetWriter, PrimitiveChunkedBuilder, Series, UInt32Type, df, }, series::IntoSeries, }; diff --git a/contrib/crunch-v2/src/main.rs b/contrib/crunch-v2/src/main.rs index 5be8c28e2..b0502f823 100644 --- a/contrib/crunch-v2/src/main.rs +++ b/contrib/crunch-v2/src/main.rs @@ -15,7 +15,7 @@ mod remote; use anyhow::Result; use clap::Parser; -use futures::{stream, StreamExt, TryStreamExt}; +use futures::{StreamExt, TryStreamExt, stream}; use indicatif::{ProgressBar, ProgressStyle}; use std::{ io::{self, BufRead, Read, Write}, @@ -24,7 +24,7 @@ use std::{ }; use polars::{ - prelude::{col, LazyFrame, ScanArgsParquet}, + prelude::{LazyFrame, ScanArgsParquet, col}, sql::sql_expr, }; diff --git a/contrib/crunch-v2/src/remote.rs b/contrib/crunch-v2/src/remote.rs index 93952ecd7..77a14f901 100644 --- a/contrib/crunch-v2/src/remote.rs +++ b/contrib/crunch-v2/src/remote.rs @@ -5,16 +5,16 @@ use std::{ task::{self, Poll}, }; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use bytes::{Buf, Bytes}; -use futures::{future::BoxFuture, Future, FutureExt, Stream, StreamExt}; +use futures::{Future, FutureExt, Stream, StreamExt, future::BoxFuture}; use lazy_static::lazy_static; use tokio::runtime::Handle; use nix_compat::nixbase32; use rusoto_core::{ByteStream, Region}; -use rusoto_s3::{GetObjectOutput, GetObjectRequest, S3Client, S3}; +use rusoto_s3::{GetObjectOutput, GetObjectRequest, S3, S3Client}; use bzip2::read::BzDecoder; use xz2::read::XzDecoder; @@ -106,7 +106,7 @@ impl FileKey { &self, offset: u64, e_tag: Option<&str>, - ) -> impl Future> + Send + 'static { + ) -> impl Future> + Send + 'static + use<> { let input = GetObjectRequest { bucket: BUCKET.to_string(), key: format!( diff --git a/contrib/fetchroots/Cargo.nix b/contrib/fetchroots/Cargo.nix index 8cb557bd5..d13e7f8ed 100644 --- a/contrib/fetchroots/Cargo.nix +++ b/contrib/fetchroots/Cargo.nix @@ -3682,7 +3682,7 @@ rec { "fetchroots" = rec { crateName = "fetchroots"; version = "0.0.0"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "fetchroots"; diff --git a/contrib/fetchroots/Cargo.toml b/contrib/fetchroots/Cargo.toml index 5dd98732b..a02c4b772 100644 --- a/contrib/fetchroots/Cargo.toml +++ b/contrib/fetchroots/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fetchroots" version = "0.0.0" -edition = "2021" +edition = "2024" [workspace] members = ["."] diff --git a/contrib/fetchroots/rustfmt.toml b/contrib/fetchroots/rustfmt.toml new file mode 100644 index 000000000..f216078d9 --- /dev/null +++ b/contrib/fetchroots/rustfmt.toml @@ -0,0 +1 @@ +edition = "2024" diff --git a/contrib/fetchroots/src/main.rs b/contrib/fetchroots/src/main.rs index 563f57712..0110340e7 100644 --- a/contrib/fetchroots/src/main.rs +++ b/contrib/fetchroots/src/main.rs @@ -28,7 +28,7 @@ use nix_compat::nixbase32; use polars::prelude::*; use tokio::{ sync::Semaphore, - task::{block_in_place, JoinSet}, + task::{JoinSet, block_in_place}, }; #[derive(Debug)] diff --git a/contrib/narinfo2parquet/Cargo.nix b/contrib/narinfo2parquet/Cargo.nix index 6a43dc436..c9cd1e7f4 100644 --- a/contrib/narinfo2parquet/Cargo.nix +++ b/contrib/narinfo2parquet/Cargo.nix @@ -2749,7 +2749,7 @@ rec { "narinfo2parquet" = rec { crateName = "narinfo2parquet"; version = "0.1.0"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "narinfo2parquet"; diff --git a/contrib/narinfo2parquet/Cargo.toml b/contrib/narinfo2parquet/Cargo.toml index f72bbeeac..e4a5d46aa 100644 --- a/contrib/narinfo2parquet/Cargo.toml +++ b/contrib/narinfo2parquet/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "narinfo2parquet" version = "0.1.0" -edition = "2021" +edition = "2024" # We can't join the //tvix workspace, because that locks zstd # at an ancient version, which is incompatible with polars diff --git a/contrib/narinfo2parquet/rustfmt.toml b/contrib/narinfo2parquet/rustfmt.toml new file mode 100644 index 000000000..f216078d9 --- /dev/null +++ b/contrib/narinfo2parquet/rustfmt.toml @@ -0,0 +1 @@ +edition = "2024" diff --git a/contrib/narinfo2parquet/src/main.rs b/contrib/narinfo2parquet/src/main.rs index d871025d4..971b146cb 100644 --- a/contrib/narinfo2parquet/src/main.rs +++ b/contrib/narinfo2parquet/src/main.rs @@ -7,7 +7,7 @@ //! mkdir narinfo.pq && ls narinfo.zst | parallel --bar 'narinfo2parquet {}' //! ``` -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use jemallocator::Jemalloc; use nix_compat::{ narinfo::{self, NarInfo}, diff --git a/contrib/snixbolt/Cargo.nix b/contrib/snixbolt/Cargo.nix index c5074bc94..ac5388830 100644 --- a/contrib/snixbolt/Cargo.nix +++ b/contrib/snixbolt/Cargo.nix @@ -4193,7 +4193,7 @@ rec { "snixbolt" = rec { crateName = "snixbolt"; version = "0.1.0"; - edition = "2021"; + edition = "2024"; src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; }; type = [ "cdylib" ]; dependencies = [ diff --git a/contrib/snixbolt/Cargo.toml b/contrib/snixbolt/Cargo.toml index 6185a3d8a..f9928b982 100644 --- a/contrib/snixbolt/Cargo.toml +++ b/contrib/snixbolt/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "snixbolt" version = "0.1.0" -edition = "2021" +edition = "2024" [lib] crate-type = ["cdylib"] diff --git a/contrib/snixbolt/rustfmt.toml b/contrib/snixbolt/rustfmt.toml new file mode 100644 index 000000000..f216078d9 --- /dev/null +++ b/contrib/snixbolt/rustfmt.toml @@ -0,0 +1 @@ +edition = "2024" diff --git a/contrib/snixbolt/src/lib.rs b/contrib/snixbolt/src/lib.rs index 6624833ac..c17bb8cbb 100644 --- a/contrib/snixbolt/src/lib.rs +++ b/contrib/snixbolt/src/lib.rs @@ -11,8 +11,8 @@ use snix_eval::observer::{DisassemblingObserver, TracingObserver}; use wasm_bindgen::prelude::wasm_bindgen; use web_sys::HtmlDetailsElement; use web_sys::HtmlTextAreaElement; -use yew::prelude::*; use yew::TargetCast; +use yew::prelude::*; use yew_router::history::BrowserHistory; use yew_router::history::History; diff --git a/contrib/turbofetch/Cargo.nix b/contrib/turbofetch/Cargo.nix index e73010cc6..4bcb03583 100644 --- a/contrib/turbofetch/Cargo.nix +++ b/contrib/turbofetch/Cargo.nix @@ -4348,7 +4348,7 @@ rec { "turbofetch" = rec { crateName = "turbofetch"; version = "0.1.0"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "turbofetch"; diff --git a/contrib/turbofetch/Cargo.toml b/contrib/turbofetch/Cargo.toml index fa6a9253a..eac2c0f9a 100644 --- a/contrib/turbofetch/Cargo.toml +++ b/contrib/turbofetch/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "turbofetch" version = "0.1.0" -edition = "2021" +edition = "2024" # We don't join the //snix workspace, as this is fairly cache.nixos.org-specific. [workspace] diff --git a/contrib/turbofetch/rustfmt.toml b/contrib/turbofetch/rustfmt.toml new file mode 100644 index 000000000..f216078d9 --- /dev/null +++ b/contrib/turbofetch/rustfmt.toml @@ -0,0 +1 @@ +edition = "2024" diff --git a/contrib/turbofetch/src/main.rs b/contrib/turbofetch/src/main.rs index 4b3a50eb3..15b6caff9 100644 --- a/contrib/turbofetch/src/main.rs +++ b/contrib/turbofetch/src/main.rs @@ -21,9 +21,9 @@ //! write any output. use bytes::Bytes; -use futures::{stream::FuturesUnordered, Stream, TryStreamExt}; +use futures::{Stream, TryStreamExt, stream::FuturesUnordered}; use rusoto_core::ByteStream; -use rusoto_s3::{GetObjectRequest, PutObjectRequest, S3Client, S3}; +use rusoto_s3::{GetObjectRequest, PutObjectRequest, S3, S3Client}; use serde::Deserialize; use std::{io::Write, mem, ops::Range, ptr}; use tokio::{ @@ -34,7 +34,7 @@ use tokio::{ /// Fetch a group of keys, streaming concatenated chunks as they arrive from S3. /// `keys` must be a slice from the job file. Any network error at all fails the /// entire batch, and there is no rate limiting. -fn fetch(keys: &[[u8; 32]]) -> impl Stream> { +fn fetch(keys: &[[u8; 32]]) -> impl Stream> + use<> { // S3 supports only HTTP/1.1, but we can ease the pain somewhat by using // HTTP pipelining. It terminates the TCP connection after receiving 100 // requests, so we chunk the keys up accordingly, and make one connection diff --git a/contrib/weave/Cargo.nix b/contrib/weave/Cargo.nix index 09f9e59ba..46ea84b28 100644 --- a/contrib/weave/Cargo.nix +++ b/contrib/weave/Cargo.nix @@ -7570,7 +7570,7 @@ rec { "weave" = rec { crateName = "weave"; version = "0.1.0"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "swizzle"; diff --git a/contrib/weave/Cargo.toml b/contrib/weave/Cargo.toml index 3f8a2a86b..78b66f51f 100644 --- a/contrib/weave/Cargo.toml +++ b/contrib/weave/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "weave" version = "0.1.0" -edition = "2021" +edition = "2024" [workspace] members = ["."] diff --git a/contrib/weave/rustfmt.toml b/contrib/weave/rustfmt.toml new file mode 100644 index 000000000..f216078d9 --- /dev/null +++ b/contrib/weave/rustfmt.toml @@ -0,0 +1 @@ +edition = "2024" diff --git a/contrib/weave/src/bin/swizzle.rs b/contrib/weave/src/bin/swizzle.rs index 1e84025e6..b5b5ffa07 100644 --- a/contrib/weave/src/bin/swizzle.rs +++ b/contrib/weave/src/bin/swizzle.rs @@ -33,13 +33,13 @@ use anyhow::Result; use hashbrown::HashTable; use polars::{ - lazy::dsl::{col, SpecialEq}, + lazy::dsl::{SpecialEq, col}, prelude::*, }; use tracing::info_span; use tracing_indicatif::span_ext::IndicatifSpanExt as _; -use weave::{as_fixed_binary, hash64, leak, load_ph_array, INDEX_NULL}; +use weave::{INDEX_NULL, as_fixed_binary, hash64, leak, load_ph_array}; #[tracing::instrument] fn main() -> Result<()> { diff --git a/contrib/weave/src/main.rs b/contrib/weave/src/main.rs index 179befc85..2ce865821 100644 --- a/contrib/weave/src/main.rs +++ b/contrib/weave/src/main.rs @@ -6,7 +6,7 @@ //! the row numbers in `narinfo.parquet` corresponding to live paths. use anyhow::Result; -use hashbrown::{hash_table, HashTable}; +use hashbrown::{HashTable, hash_table}; use rayon::prelude::*; use rustc_hash::FxHashSet; use std::{ @@ -25,7 +25,7 @@ use polars::{ prelude::*, }; -use weave::{as_fixed_binary, hash64, INDEX_NULL}; +use weave::{INDEX_NULL, as_fixed_binary, hash64}; #[tracing::instrument] fn main() -> Result<()> {