Skip to content

ctutils: add CtFind trait#1361

Merged
tarcieri merged 1 commit into
masterfrom
ctutils/ct_find
Jan 16, 2026
Merged

ctutils: add CtFind trait#1361
tarcieri merged 1 commit into
masterfrom
ctutils/ct_find

Conversation

@tarcieri

Copy link
Copy Markdown
Member

Adds a trait with a similar shape to the Iterator::find method, which returns the first item in a collection that matches a given predicate.

The trait is impl'd for [T; N] and [T]whereT: CtSelect + Default`.

This also adds a helper method used in the implementation CtOption::insert_if which is made public, and CtOption::insert which mirrors Option::insert for consistency.

Adds a trait with a similar shape to the `Iterator::find` method, which
returns the first item in a collection that matches a given predicate.

The trait is impl'd for `[T; N] and `[T]` where `T: CtSelect + Default`.
@tarcieri tarcieri merged commit 513a1a5 into master Jan 16, 2026
12 checks passed
@tarcieri tarcieri deleted the ctutils/ct_find branch January 16, 2026 21:10
@tarcieri tarcieri mentioned this pull request Jan 16, 2026
tarcieri added a commit that referenced this pull request Jan 16, 2026
### Added
- `BytesCtEq` and `BytesCtSelect` traits (#1359)
- `CtFind` trait (#1361)
- `CtLookup` trait (#1362)

### Changed
- Bump `cmov` crate dependency to v0.5.0-pre.0 (#1357)
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.

1 participant