Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well... he does have a point. Don't demonstrate your great tool with an issue that the existing solution doesn't actually have.





Learning Rust ATM and using bindgen on a C header. Just looked and it generates Rust enums from C enums. I'm not sure what the default behavior of bindgen is, but it seems there is option for constifying enums

--constified-enum <REGEX> Mark any enum whose name matches REGEX as a series of constants

--constified-enum-module <REGEX> Mark any enum whose name matches REGEX as a module of constants

IMO, saying bindgen avoids the issue presented in the article is not accurate.

edit: formatting


https://gist.github.com/xTachyon/a2d05ae580a939f2d6f4f655091...

You can force it to generate Rust enums, but it doesn't by default.


Does it mark them as non-exhaustive?



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: