Skip to content

chore: improve slab maintenance path#162

Open
vip892766gma wants to merge 1 commit into
tokio-rs:masterfrom
vip892766gma:maint/20260526091348
Open

chore: improve slab maintenance path#162
vip892766gma wants to merge 1 commit into
tokio-rs:masterfrom
vip892766gma:maint/20260526091348

Conversation

@vip892766gma

Copy link
Copy Markdown

Summary:

  • Add narrow edge-case unit tests covering currently-untested branches of the public API: e.g. (1) VacantEntry::key returning the same key that the subsequent insert assigns after compact() reshuffles indices, (2) Drain semantics when the slab is empty and when Drain is dropped before iteration completes (verifying remaining entries are cleared), and (3) get2_mut / get_disjoint_mut returning None for equal indices and for an out-of-bounds index paired with a valid one. Each test is a few lines, exercises an existing branch without changing behavior, and strengthens regression coverage.
  • Keep the change narrow so it is straightforward to review.

Notes:

  • I kept this scoped to the relevant implementation and tests.

@Darksonn

Copy link
Copy Markdown
Member

Can you explain the name of this PR? I'm noticing other PRs with similar names, and the name does not make sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants