Skip to content

Commit

Permalink
use chunk_by from rust 1.77
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Mar 28, 2024
1 parent ef8a119 commit 013c9b6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 38 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ categories = ["games"]
keywords = ["chess", "syzygy", "tablebase"]
exclude = ["tables/**/*.*tb*"]
edition = "2021"
rust-version = "1.77"

[[bench]]
name = "benches"
Expand Down
31 changes: 0 additions & 31 deletions src/chunk_by.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

#[macro_use]
mod errors;
mod chunk_by;
mod material;
mod table;
mod tablebase;
Expand Down
9 changes: 3 additions & 6 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use positioned_io::{RandomAccessFile, ReadAt, ReadBytesAtExt as _};
use shakmaty::{Bitboard, Color, File, Piece, Position, Rank, Role, Square};

use crate::{
chunk_by::ChunkBy,
errors::{ProbeError, ProbeResult},
material::Material,
types::{DecisiveWdl, MaybeRounded, Metric, Pieces, Syzygy, Wdl, MAX_PIECES},
Expand Down Expand Up @@ -473,11 +472,9 @@ fn group_pieces(pieces: &Pieces) -> ArrayVec<usize, MAX_PIECES> {

// The remaining identical pieces are grouped together.
result.extend(
ChunkBy {
slice: &pieces[first_len..],
predicate: |l: &Piece, r: &Piece| l == r,
}
.map(|chunk| chunk.len()),
pieces[first_len..]
.chunk_by(Piece::eq)
.map(|chunk| chunk.len()),
);

result
Expand Down

0 comments on commit 013c9b6

Please sign in to comment.