Skip to content

Commit

Permalink
Update itertools to 13 (#1433)
Browse files Browse the repository at this point in the history
Replaced deprecated group_by() with suggested replacement chunk_by()


https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.group_by
  • Loading branch information
leftwo authored Aug 26, 2024
1 parent a0b3729 commit 2073b0b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
17 changes: 13 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ humantime = "2.1.0"
hyper = { version = "0.14", features = [ "full" ] }
hyper-staticfile = "0.9.6"
indicatif = { version = "0.17.8", features = ["rayon"] }
itertools = "0.12.1"
itertools = "0.13.0"
libc = "0.2"
mime_guess = "2.0.5"
nbd = "0.3.1"
Expand Down
6 changes: 3 additions & 3 deletions downstairs/src/extent_inner_raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ impl RawInner {
let mut writes = 0u64;
for (slot, group) in block_contexts
.iter()
.group_by(|block_context| {
.chunk_by(|block_context| {
// We'll be writing to the inactive slot
!self.active_context[block_context.block as usize]
})
Expand Down Expand Up @@ -911,7 +911,7 @@ impl RawInner {
let mut out = Vec::with_capacity(count as usize);
let mut reads = 0u64;
for (slot, group) in (block..block + count)
.group_by(|block| self.active_context[*block as usize])
.chunk_by(|block| self.active_context[*block as usize])
.into_iter()
{
let mut group = group.peekable();
Expand Down Expand Up @@ -943,7 +943,7 @@ impl RawInner {
// Perform writes, which may be broken up by skipped blocks
let block_size = self.extent_size.block_size_in_bytes() as u64;
for (skip, mut group) in (0..write.block_contexts.len())
.group_by(|i| writes_to_skip.contains(i))
.chunk_by(|i| writes_to_skip.contains(i))
.into_iter()
{
if skip {
Expand Down
2 changes: 1 addition & 1 deletion downstairs/src/extent_inner_sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ impl SqliteMoreInner {

// Perform writes, which may be broken up by skipped blocks
for (skip, mut group) in (0..write.block_contexts.len())
.group_by(|i| writes_to_skip.contains(i))
.chunk_by(|i| writes_to_skip.contains(i))
.into_iter()
{
if skip {
Expand Down
2 changes: 1 addition & 1 deletion upstairs/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Buffer {
.blocks
.iter()
.enumerate()
.group_by(|(_i, b)| matches!(b, ReadBlockContext::Empty))
.chunk_by(|(_i, b)| matches!(b, ReadBlockContext::Empty))
{
if empty {
continue;
Expand Down

0 comments on commit 2073b0b

Please sign in to comment.