-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
lang: Handle const array size casting and add const array size support for events #1485
lang: Handle const array size casting and add const array size support for events #1485
Conversation
lang/syn/src/idl/file.rs
Outdated
_ => false, | ||
}) { | ||
let size_string = format!("{}]", &constant.ident.to_string()); | ||
let cast_size_string = format!("{} as usize]", &constant.ident.to_string()); |
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.
wdyt about removing the whitespace here and in tts_string
and then comparing those instead? would really suck to debug an error that's caused by an additional whitespace between as
and usize
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.
No sympathy for people who don't use code formatters. 😈
I think it's an unlikely case but I'll add it if you like. Regex would probably have fewer edge cases but adding that seems a bit over the top.
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.
some people run their formatters before they commit and not during coding. still unlikely that it even happens but doesnt hurt to add it
agree that regex seems over the top
tyvm! |
Closes #1476
Closes #1357