-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Put example in Readme #22
Comments
I don't think the code you've suggested would add any value in making sense of the API. |
IMO it'd still be worthwhile to mention which functions the API actually provides, without having to search quite as much. |
But yes, the example isn't that well chosen. Here'd be a possibly more useful example. (Untested though) fn is_identifier(value: &str) {
let mut chars = value.chars();
chars.next().filter(|c| is_xid_start(*c)).is_some() && chars.all(|c| is_xid_continue(c))
}
is_identifier("cat1"); // returns true
is_identifier("42"); // returns false |
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it be possible to have a minimal example at the top of the readme that showcases the really sleek API? Something like
Also, thank you very much for all your awesome work on those lovely Rust projects!
The text was updated successfully, but these errors were encountered: