3 ms·
unsafe rust code is not safe, but the rest of the program is, and the unsafe blocks provides very nice benefits: - limit the size and scope of the unsafe code
by BiteCode_dev 5y ago
unsafe rust code is not safe, but the rest of the program is, and the unsafe blocks provides very nice benefits:
- limit the size and scope of the unsafe code
- make the unsafe part stand out, "here be dragons", so you know when to be particularly alert
- act as a safe way to encapsulate unsafe code so that it can be used by safe code, and used without the lack of safety propagating outside of the unsafe zone