Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Regex type and rename it to PreventSyncPattern #9049

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

touilleMan
Copy link
Member

No description provided.

@touilleMan touilleMan requested a review from a team as a code owner November 29, 2024 14:20
@touilleMan touilleMan force-pushed the simplify-regex branch 4 times, most recently from d3f86d3 to 424bd3e Compare November 29, 2024 14:55
#[derive(Error, Debug)]
pub enum PreventSyncPatternError {
#[error("Regex parsing error: {err}")]
BadRegex { err: regex::Error },
Copy link
Contributor

Choose a reason for hiding this comment

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

Use tuple style for error since it only has one value.

That simplify errors handling since we can do

.map_error(PreventSyncPattern::BadRegex)

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a very good point ! thx

- Remove useless $ escape code (already handled by `fnmatch_regex`)
- Fix panic in libparsec bindings when config contains invalid pattern
- Remove parsing from file to simplify API
- More consistent naming in methods
- Add more tests \o/
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