diff --git a/crates/ruff_cli/src/commands/add_noqa.rs b/crates/ruff_cli/src/commands/add_noqa.rs index b3d2b0af6f1b7..f56670d7bace0 100644 --- a/crates/ruff_cli/src/commands/add_noqa.rs +++ b/crates/ruff_cli/src/commands/add_noqa.rs @@ -11,7 +11,6 @@ use ruff::resolver::PyprojectDiscovery; use ruff::{packaging, resolver, warn_user_once}; use crate::args::Overrides; -use crate::iterators::par_iter; /// Add `noqa` directives to a collection of files. pub fn add_noqa( @@ -42,7 +41,8 @@ pub fn add_noqa( ); let start = Instant::now(); - let modifications: usize = par_iter(&paths) + let modifications: usize = paths + .par_iter() .flatten() .filter_map(|entry| { let path = entry.path(); diff --git a/crates/ruff_cli/src/commands/run.rs b/crates/ruff_cli/src/commands/run.rs index cb54a59b4f965..308744fb2c16b 100644 --- a/crates/ruff_cli/src/commands/run.rs +++ b/crates/ruff_cli/src/commands/run.rs @@ -19,7 +19,6 @@ use ruff_diagnostics::Diagnostic; use crate::args::Overrides; use crate::cache; use crate::diagnostics::{lint_path, Diagnostics}; -use crate::iterators::par_iter; /// Run the linter over a collection of files. pub fn run( @@ -76,7 +75,8 @@ pub fn run( ); let start = Instant::now(); - let mut diagnostics: Diagnostics = par_iter(&paths) + let mut diagnostics: Diagnostics = paths + .par_iter() .map(|entry| { match entry { Ok(entry) => { diff --git a/crates/ruff_cli/src/iterators.rs b/crates/ruff_cli/src/iterators.rs deleted file mode 100644 index 80603b1637f93..0000000000000 --- a/crates/ruff_cli/src/iterators.rs +++ /dev/null @@ -1,16 +0,0 @@ -#[cfg(not(target_family = "wasm"))] -use rayon::prelude::*; - -/// Shim that calls `par_iter` except for wasm because there's no wasm support -/// in rayon yet (there is a shim to be used for the web, but it requires js -/// cooperation) Unfortunately, `ParallelIterator` does not implement `Iterator` -/// so the signatures diverge -#[cfg(not(target_family = "wasm"))] -pub fn par_iter(iterable: &[T]) -> impl ParallelIterator { - iterable.par_iter() -} - -#[cfg(target_family = "wasm")] -pub fn par_iter(iterable: &[T]) -> impl Iterator { - iterable.iter() -} diff --git a/crates/ruff_cli/src/lib.rs b/crates/ruff_cli/src/lib.rs index 86faf3cb8c1be..b95889c16c49c 100644 --- a/crates/ruff_cli/src/lib.rs +++ b/crates/ruff_cli/src/lib.rs @@ -18,7 +18,6 @@ pub mod args; mod cache; mod commands; mod diagnostics; -mod iterators; mod printer; mod resolve;