From 552ae3d7fbc10ac8124a868cd6297caa815b9d25 Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 6 Nov 2026 16:03:49 +0100 Subject: [PATCH 1/2] refactor(diskio): remove redundant type annotations --- src/diskio/test.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/diskio/test.rs b/src/diskio/test.rs index 6f876d7d14..360cd6eb7a 100644 --- a/src/diskio/test.rs +++ b/src/diskio/test.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use super::{Executor, Item, Kind, get_executor}; +use super::{Item, Kind, get_executor}; use crate::{process::TestProcess, test::test_dir}; impl Item { @@ -21,8 +21,7 @@ fn test_incremental_file(io_threads: &str) -> anyhow::Result<()> { let mut written = 0; let mut file_finished = false; - let mut io_executor: Box = - get_executor(32 * 1024 * 1024, tp.process.io_thread_count()?); + let mut io_executor = get_executor(32 * 1024 * 1024, tp.process.io_thread_count()?); let (item, mut sender) = Item::write_file_segmented( work_dir.path().join("scratch"), 0o666, @@ -88,8 +87,7 @@ fn test_complete_file(io_threads: &str) -> anyhow::Result<()> { vars.insert("RUSTUP_IO_THREADS".to_string(), io_threads.to_string()); let tp = TestProcess::with_vars(vars); - let mut io_executor: Box = - get_executor(32 * 1024 * 1024, tp.process.io_thread_count()?); + let mut io_executor = get_executor(32 * 1024 * 1024, tp.process.io_thread_count()?); let mut chunk = io_executor.get_buffer(10); chunk.extend(b"0123456789"); assert_eq!(chunk.len(), 10); From c66c8650d1ad67d1e73e4b80fba48363ff4e3fba Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 6 Nov 2026 16:25:13 +0100 Subject: [PATCH 2/2] fix(diskio): stop `warn!()`ing in `get_executor()` --- src/diskio/mod.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/diskio/mod.rs b/src/diskio/mod.rs index ebcc54a847..3a9369e836 100644 --- a/src/diskio/mod.rs +++ b/src/diskio/mod.rs @@ -65,7 +65,7 @@ use std::{ }; use anyhow::anyhow; -use tracing::{error, trace, warn}; +use tracing::{debug, error, trace, warn}; use crate::{ diskio::immediate::{FileState, IncrementalFileWriter}, @@ -474,12 +474,10 @@ pub(super) fn get_executor<'a>( fn effective_thread_count(ram_budget: usize, thread_count: IoThreadCount) -> usize { match thread_count { IoThreadCount::Default(n) if n > 1 && ram_budget < LOW_MEMORY_THRESHOLD => { - warn!( - "using single-threaded unpacking due to low memory \ - (ram budget: {} < {} threshold), \ - set RUSTUP_IO_THREADS to override", + debug!( + "using single-threaded unpacking due to low memory (ram budget: {} < {} threshold), set RUSTUP_IO_THREADS to override", Size::new(ram_budget), - Size::new(LOW_MEMORY_THRESHOLD) + Size::new(LOW_MEMORY_THRESHOLD), ); 1 }