Skip to content

Conversation

@sdroege
Copy link
Member

@sdroege sdroege commented Nov 21, 2025

No description provided.

Errors are independent of the return value, which signals whether there
was a match or not. No match is not an error.

Also a match info is always provided unless there is an error.

Fixes gtk-rs#1848
@sdroege sdroege added the needs-backport PR needs backporting to the current stable branch label Nov 21, 2025
start_position: i32,
match_options: RegexMatchFlags,
) -> Result<MatchInfo<'input>, crate::Error> {
) -> Result<(bool, MatchInfo<'input>), crate::Error> {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a breaking API change but the current API makes little sense.

If we want to preserve the API we could omit the bool return value and instead require the caller to check match_info.matches() which provides the very same information. It's a bit redundant right now but closer to the C API.

@bilelmoussaoui Any opinions?

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

Labels

needs-backport PR needs backporting to the current stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants