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

Support using validators without attr_literals feature #5

Closed
dtolnay opened this issue Dec 28, 2016 · 2 comments
Closed

Support using validators without attr_literals feature #5

dtolnay opened this issue Dec 28, 2016 · 2 comments

Comments

@dtolnay
Copy link

dtolnay commented Dec 28, 2016

Obvious follow-up to #4 I guess.

I know this is more user-friendly: #[validate(range(min = 18, max = 20))]

But would it be possible to support this as well? #[validate(range(min = "18", max = "20"))]

And similar for the other validators. This would allow validators to be used on stable Rust 1.15.

It looks like this may be as simple as just extending the lit_to_int and lit_to_float functions to handle string literals.

@Keats
Copy link
Owner

Keats commented Dec 28, 2016

Yeah, that's the easy solution I think

@Keats
Copy link
Owner

Keats commented Jan 17, 2017

Tooks lots of time but it's in 0.2.0 (along with struct level validation)

@Keats Keats closed this as completed Jan 17, 2017
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

No branches or pull requests

2 participants