-
Notifications
You must be signed in to change notification settings - Fork 3
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
Handle type restrictions #2
Comments
we could test every function with: fn validate_1_n(arg: i32) {
assert!(arg > 1, "You shall not pass a number lower than 1");
} Maybe extend it with https://github.com/alexcrichton/backtrace-rs to display nicer messages including the calling function. |
If it happens at runtime, I'd rather go with something like |
Yeah definitely go with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Gerber spec specifies a list of data types:
We should make sure that only valid values accrding to the spec can be passed in to types expecting these basic data types.
This means that we probably won't get around creating custom wrapper types.
Is there a way to create range types in Rust, e.g. a 32 bit signed integer >= 1? Or strings that only accept certain unicode codepoints? Ideally as much as possible at compile time.
@rnestler @dns2utf8
The text was updated successfully, but these errors were encountered: