Skip to content

Commit

Permalink
use Itertools::chunk_by instead of Itertools::group_by
Browse files Browse the repository at this point in the history
Summary: They have the same functionality but `group_by` is deprecated.

Reviewed By: RajivTS, lmvasquezg

Differential Revision: D64534935

fbshipit-source-id: 51567c212dec8f5fee0de7b0f445c129b8550bde
  • Loading branch information
YousefSalama authored and facebook-github-bot committed Oct 17, 2024
1 parent c749d2f commit 95f9967
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion eden/mononoke/cmds/blobstore_healer/wal_healer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl WalHealer {
let healing_futures: Vec<(_, u64)> = queue_entries
.into_iter()
.sorted_by_key(|entry| entry.blobstore_key.clone())
.group_by(|entry| entry.blobstore_key.clone())
.chunk_by(|entry| entry.blobstore_key.clone())
.into_iter()
.map(|(key, entries)| {
let entries: Vec<_> = entries.into_iter().collect();
Expand Down
4 changes: 2 additions & 2 deletions eden/mononoke/features/history_traversal/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ async fn process_deletion_nodes(
deleted_to_last_mapping.sort_by_key(|(deleted_linknode, _)| *deleted_linknode);
deleted_to_last_mapping
.into_iter()
.group_by(|(deleted_linknode, _)| **deleted_linknode)
.chunk_by(|(deleted_linknode, _)| **deleted_linknode)
.into_iter()
.for_each(|(deleted_linknode, grouped_last)| {
history_graph.insert(
Expand Down Expand Up @@ -789,7 +789,7 @@ async fn augment_history_graph_insertions_with_mutable_ancestry(
graph_insertions.sort_unstable_by_key(|((_, path), _)| path.clone());
let graph_insertions_by_path = graph_insertions
.into_iter()
.group_by(|((_, path), _)| path.clone());
.chunk_by(|((_, path), _)| path.clone());
let graph_insertions_by_path = graph_insertions_by_path
.into_iter()
.map(|(k, v)| (k, v.collect::<Vec<_>>()))
Expand Down
2 changes: 1 addition & 1 deletion eden/mononoke/newfilenodes/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ async fn select_paths<I: Iterator<Item = PathHashBytes>>(
recorder: &PerfCounterRecorder<'_>,
) -> Result<HashMap<PathHashBytes, PathBytes>, ErrorKind> {
let futs = iter
.group_by(|path_hash| connections.shard_id(path_hash))
.chunk_by(|path_hash| connections.shard_id(path_hash))
.into_iter()
.map(|(shard_id, group)| {
let group = group.collect::<Vec<_>>();
Expand Down
2 changes: 1 addition & 1 deletion eden/mononoke/walker/src/detail/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ impl TailingWalkVisitor for WalkState {
.deferred_bcs
.iter()
.flat_map(|e| e.value().clone())
.group_by(|e| e.label)
.chunk_by(|e| e.label)
.into_iter()
.map(|(key, group)| (key, group.count()))
.collect();
Expand Down
2 changes: 1 addition & 1 deletion eden/mononoke/walker/src/detail/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl ValidatingVisitor {
),
checks_by_node_type: include_checks
.into_iter()
.group_by(|c| c.node_type())
.chunk_by(|c| c.node_type())
.into_iter()
.map(|(key, group)| (key, HashSet::from_iter(group)))
.collect(),
Expand Down

0 comments on commit 95f9967

Please sign in to comment.