2 ms·
https://github.com/actix/actix-web/search?utf8=%E2%9C%93&q=unsafe&type= https://github.com/actix/actix-web/search?utf8=%E2%9C%93&q=u...
by HugoDaniel 8y ago
https://github.com/actix/actix-web/search?utf8=%E2%9C%93&q=unsafe&type= https://github.com/actix/actix-web/search?utf8=%E2%9C%93&q=u...
- Nimelrian 8y agoGood rust code doesn't have to be free of unsafe blocks. In some cases you can't avoid them, e.g. when doing memory mapping. Instead, the unsafe blocks semantically designate areas you should keep an eye on. I rather have 20 unsafe one-liners surrounded by safe wrappers in a project with several thousand LOC, than a 1k LOC C project where I have to take extra care with every step.
- steveklabnik 8y agoSure. I haven’t looked at these exact blocks, but the point is that they were using tons of unsafe that they didn’t need to. Unsafe exists to be used, when it’s neccesary. 11 now? Iirc it was on the order of 100 before.
- HugoDaniel 8y ago11 files, showing only the top two references per file. In a proper grep it shows about 35 unsafe references. Not bad indeed.