-
Notifications
You must be signed in to change notification settings - Fork 192
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
Use associated constants for extension names #79
Comments
Yes that makes sense, also extension names need to be changed anyway because they really should reuse the generated extensions names from the I am sorry for blocking you on the generator branch. I don't have that much time right now, I thought I would have finished it last week but a few minor problems delayed it. I'll might find some time this week to finish it, if I don't encounter more problems. |
No worries, I'm not really blocked, I just feel a little bad opening issues instead of PRs. |
On review, I realized that the relevant type should probably be |
There is also the issue where the first thing you'll wanting to do with these names is compare to [i8; 256]s. A helper for this purpose would be appreciated. |
Your code would be a lot simpler and safer there if you constructed a |
There is no fixed size array with null "padding" to CStr function. The CStr::from_bytes_with_nul() takes a slice and must end exactly with a trailing null. It's an error if the string is shorter than the slice intermediate representation, see FromBytesWithNulError::interior_nul. No, I'm satisfied that using libc's strncmp() here is the better option ""given all I can easily learn about CStr and CString."" |
For example, you can do |
From strncmp() to sys::strlen(), I don't see this as an improvement. I could call str"n"len() and then CStr::from_bytes_with_nul_unchecked myself and it would be safer... but getting the length is going out of the way, it's better to just do the compare and get it over with. See KISS. |
It is now possible to do this since For the unrelated |
e.g. replace
ash::extensions::Swapchain::name
with...::NAME
being a constant of type&'static str
. Simple consistency/clarity matter. I'd happily do this myself but, as always, I don't want to step on toes regarding/make changes mooted by the pending rewrite.The text was updated successfully, but these errors were encountered: