HomePhabricator
Diffusion Comm a317e958ca9e

[comm-lib] Add util to split vec into n chunks

Description

[comm-lib] Add util to split vec into n chunks

Summary:
The built-in vec.chunks(5) splits given collection into chunks of 5 items. Number of chunks is determined based on collection size.
However, there's no built-in utility for splitting collection into 5 chunks, where chunk sizes are determined based on collection size.

There are crates like itertools but it's an overkill to add a new dependency for such simple utility.
Created a simple trait that adds this functionality.

Test Plan: Unit tests

Reviewers: kamil, varun, will

Reviewed By: varun

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D13129

Details

Provenance
bartekAuthored on Aug 21 2024, 1:07 AM
Reviewer
varun
Differential Revision
D13129: [comm-lib] Add util to split vec into n chunks
Parents
rCOMM0d6674251cd8: Revert "[lib] Temporarily flip usingCommServicesAccessToken to false"
Branches
Unknown
Tags
Unknown