Skip to content

Conversation

@SOF3
Copy link
Owner

@SOF3 SOF3 commented Nov 13, 2025

This matches the std::vec extract_if implementation

Copilot AI review requested due to automatic review settings November 13, 2025 14:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a range parameter to the extract_if method to match the standard library's Vec::extract_if implementation. This is a breaking change that allows users to specify which range of elements should be considered for extraction.

Key changes:

  • Added a range: impl RangeBounds<usize> parameter to extract_if method
  • Introduced a new resolve_range helper function to normalize range bounds into concrete start/end indices
  • Updated the Retain struct to support ranged operations with a stop_len field
  • Added comprehensive test coverage for ranged extraction scenarios

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/lib.rs Added resolve_range helper function, updated extract_if to accept range parameter, refactored drain to use resolve_range
src/retain.rs Modified Retain struct to support ranges with stop_len field, updated new() to accept range parameter, added early termination logic in next(), implemented FusedIterator for ExtractIf
src/tests.rs Updated existing tests to use .. range, added new test cases for ranged extraction including empty ranges and partial ranges

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SOF3 SOF3 force-pushed the extract-if-ranged branch from 5f84e2d to 4d09c04 Compare December 14, 2025 10:44
Copilot AI review requested due to automatic review settings December 14, 2025 10:44
SOF3 added 2 commits December 14, 2025 18:47
This matches the std::vec extract_if implementation
due to breaking change from extract_if parameters
@SOF3 SOF3 force-pushed the extract-if-ranged branch from 4d09c04 to 53f0eb6 Compare December 14, 2025 10:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SOF3 SOF3 merged commit 53f0eb6 into master Dec 14, 2025
11 checks passed
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