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

Start implementing range support for NonZero types #270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timvisee
Copy link

@timvisee timvisee commented Aug 31, 2023

Fixes #269.

Implements support for using the range validator on NonZero types from the standard library such as NonZeroU64.

This is just a start and is definitely not ready to be merged. I'm sure some important edge cases are missed. I'm not familiar with this codebase.

I'd like to know if implementing something like this is in-scope before putting more effort into it.

@Keats
Copy link
Owner

Keats commented Aug 31, 2023

Hold on, there is #262 close to being merged so it would be better to check on that branch

@timvisee
Copy link
Author

Hold on, there is #262 close to being merged so it would be better to check on that branch

Thanks for the heads up! I'll try to rebase or recreate once it's merged.

@pintariching
Copy link
Contributor

pintariching commented Sep 2, 2023

Look at the ValidateRange trait of the next branch of #262. That's where you can implement all the traits, I forgot what they're called.

@timvisee
Copy link
Author

timvisee commented Sep 4, 2023

Look at the ValidateRange trait of the next branch of #262. That's where you can implement all the traits, I forgot what they're called.

Fantastic. Much better interface to implement. I'll stall efforts on this until it is merged to prevent constant conflicts.

@Keats
Copy link
Owner

Keats commented Feb 12, 2024

Can you update the PR if you have time? I'm planning to release the changes soonish

@Keats
Copy link
Owner

Keats commented Mar 4, 2024

It's merged and released as 0.17 now

@GrantGryczan
Copy link

I know this PR needs to be updated anyway, but just for the record, it looks like this is missing NonZeroUsize.

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.

Support NonZero types
4 participants