Sub-task of #413.
What
Replace all use std:: imports in production code (non-test) with their core:: or alloc:: equivalents across the full src/ tree.
Mechanical core:: swaps (pure re-exports, no logic change)
std::fmt → core::fmt
std::fmt::* → core::fmt::*
std::ops::* → core::ops::*
std::cmp::* → core::cmp::*
std::iter::* → core::iter::*
std::slice::* → core::slice::*
std::marker::* → core::marker::*
std::mem::* → core::mem::*
std::cell::* → core::cell::*
std::hash::* → core::hash::*
alloc:: swaps (heap types, available under no_std + alloc)
std::vec::Vec → alloc::vec::Vec (or just Vec via alloc prelude)
std::string::String → alloc::string::String
std::boxed::Box → alloc::boxed::Box
std::collections::BTreeMap/BTreeSet → alloc::collections::*
Still needs #[cfg(feature = "std")]
Scope
All directories under src/: algorithm/, cluster/, decomposition/, ensemble/, linalg/, linear/, metrics/, model_selection/, naive_bayes/, neighbors/, numbers/, optimization/, preprocessing/, svm/, tree/, xgboost/, readers/, dataset/, error/, rand_custom.rs.
Approximately 115 mechanical import lines across ~20+ files (per baseline audit in #413). A lint-assisted pass with sed for the mechanical cases, then manual review for the alloc:: cases.
Acceptance
Estimated effort: ~3.5 hrs
Sub-task of #413.
What
Replace all
use std::imports in production code (non-test) with theircore::oralloc::equivalents across the fullsrc/tree.Mechanical
core::swaps (pure re-exports, no logic change)alloc::swaps (heap types, available underno_std + alloc)Still needs
#[cfg(feature = "std")]std::collections::HashMap/HashSet(not in alloc — handled in no-std Step 4: replace std::collections::HashSet in ordered_iter_mut debug check #417)std::io::*(handled in no-std Step 2: gate readers/ and dataset I/O behind #[cfg(feature = "std")] #415)std::fs::*(handled in no-std Step 2: gate readers/ and dataset I/O behind #[cfg(feature = "std")] #415)std::error::Error(handled in no-std Step 1: swap std::error::Error and std::fmt to core:: in error/mod.rs #414)Scope
All directories under
src/:algorithm/,cluster/,decomposition/,ensemble/,linalg/,linear/,metrics/,model_selection/,naive_bayes/,neighbors/,numbers/,optimization/,preprocessing/,svm/,tree/,xgboost/,readers/,dataset/,error/,rand_custom.rs.Approximately 115 mechanical import lines across ~20+ files (per baseline audit in #413). A lint-assisted pass with
sedfor the mechanical cases, then manual review for thealloc::cases.Acceptance
use std::in production code outside of#[cfg(feature = "std")]-gated blockscargo clippy --all-features -- -Drust-2018-idioms -Drust-2024-compatibility -Dwarningsexits 0cargo test --all-featurespasses (474+ unit + 68+3 doctests)Estimated effort: ~3.5 hrs