Skip to content

Commit bd5cf56

Browse files
brittanyreymeta-codesync[bot]
authored andcommitted
Remove itertools dependency
Summary: `itertools` was only used in `src/test_lib.rs` for `.sorted()` in two spots, both of which immediately collected into a `Vec`. Replaced them with a plain `Vec::sort`, which removes the only usage of the crate and lets us drop it as a dependency of `lifeguard_lib`. Removed `itertools` from `src/BUCK`, regenerated `src/Cargo.toml` via `arc autocargo`, and dropped the now-unused reference from `Cargo.lock` (the `itertools 0.14.0` package entry stays since other crates still depend on it). Reviewed By: QuantumManiac Differential Revision: D107157742 fbshipit-source-id: 52ea7f9aab98e372f7a43a197e325526b0e93e7c
1 parent 35ee061 commit bd5cf56

3 files changed

Lines changed: 6 additions & 21 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ ahash = { version = "0.8.11", features = ["serde"] }
2020
anyhow = "1.0.102"
2121
clap = { version = "4.6.0", features = ["derive", "env", "string", "unicode", "wrap_help"] }
2222
dashmap = { version = "6.1.0", features = ["rayon", "serde"] }
23-
itertools = "0.14.0"
2423
libc = "0.2.186"
2524
lifeguard_stubs = { path = "../resources" }
2625
petgraph = { version = "0.8", features = ["serde-1"] }

src/test_lib.rs

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use std::process::Command;
1212

1313
use ahash::AHashMap;
1414
use ahash::AHashSet;
15-
use itertools::Itertools;
1615
use pyrefly_python::module::Module;
1716
use pyrefly_python::module_name::ModuleName;
1817
use rayon::prelude::*;
@@ -396,15 +395,9 @@ pub fn check_imports(
396395
.pending_imports
397396
.iter()
398397
.map(|(k, v)| {
399-
(
400-
k.clone(),
401-
v.iter()
402-
.cloned()
403-
.collect::<Vec<_>>()
404-
.into_iter()
405-
.sorted()
406-
.collect::<Vec<_>>(),
407-
)
398+
let mut imports = v.iter().cloned().collect::<Vec<_>>();
399+
imports.sort();
400+
(k.clone(), imports)
408401
})
409402
.collect();
410403
expected_pending_imports.sort_by_key(|a| a.0);
@@ -413,15 +406,9 @@ pub fn check_imports(
413406
.called_imports
414407
.iter()
415408
.map(|(k, v)| {
416-
(
417-
k.clone(),
418-
v.iter()
419-
.cloned()
420-
.collect::<Vec<_>>()
421-
.into_iter()
422-
.sorted()
423-
.collect::<Vec<_>>(),
424-
)
409+
let mut imports = v.iter().cloned().collect::<Vec<_>>();
410+
imports.sort();
411+
(k.clone(), imports)
425412
})
426413
.collect();
427414
expected_called_imports.sort_by_key(|a| a.0);

0 commit comments

Comments
 (0)