-
Notifications
You must be signed in to change notification settings - Fork 440
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
doc: add a doctest to demonstrate a separately-compiled regex set #861
Conversation
8fdfc08
to
f3ceb58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The substance looks good, but there are some details that I'd like to see fixed before merging.
Also, I do think these restrictions have a very good chance of being lifted in the future with new APIs on RegexSet
. But it's still a long ways off so I agree it's worth clarifying the docs here for now.
src/re_set.rs
Outdated
/// scan the exact same input a second time with those independently compiled | ||
/// patterns: | ||
/// ```rust | ||
/// # use regex::{Regex, RegexSet}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be commented. Other examples in this crate don't comment use
lines out anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have uncommented it! However, it looks like all the other examples in this file (re_set.rs
) have this use
statement commented out -- should I fix those, too? e.g.
Line 425 in 9aef5b1
/// # use regex::RegexSet; |
Also, please squash down to one commit. |
40c7985
to
fe6dede
Compare
That's awesome to hear!! Turned on notifs for this repo! |
- explicitly link to and describe the operations that aren't available - reflow text and uncomment use statement
fe6dede
to
cd623a1
Compare
Ping! |
It took me a while to understand the recommendation for how to get
Match
objects when using aRegexSet
. I tried to rewrite that part and added a doctest to make it super clear!