-
Notifications
You must be signed in to change notification settings - Fork 63
feat: add macro #179
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
base: main
Are you sure you want to change the base?
feat: add macro #179
Conversation
add typo check to CI
crates/felt-macro/src/lib.rs
Outdated
| .. | ||
| }) => Err(Error::new_spanned( | ||
| expr, | ||
| "The `!` logical inversion operator is applicable to the `Felt` type", |
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.
Why the error message in this case is different than the one from line 209?
Why does this macro only accept the ! operator only with integer variables but doesn't with literals?
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.
It's a bit more specific, because !42 is a valid rust expression, but is invalid in the context of Felt, and the Not operator doesn't exist in this context.
The second message is about stuff like !"abc" which are not even valid Rust expression.
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.
to be honest !b'c' is a valid rust expression tho. COz it returns a u8.
So this one could be handled in the first one too
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.
done
Adding a
felt!macro that allow for easy initialization ofFeltfrom different types