4 ms·
One thing to bear in mind is that the libc and winapi crates are bindings to the libc and Windows C headers, so every single function signature in there will be
by Measter 6y ago
One thing to bear in mind is that the libc and winapi crates are bindings to the libc and Windows C headers, so every single function signature in there will be marked unsafe because it's FFI, so those will be heavily impacting your results.
You could also avoid some false positives in comments by searching for "unsafe fn" and "unsafe {", rather than just the word "unsafe", as those are the only tokens (to my knowledge) that can follow "unsafe".
- johnisgood 6y agoWithout rust/library/, libc, and winapi-rs: $ grep -irn 'unsafe {\|unsafe fn' . | wc -l 1780 Without rust/library/: $ grep -irn 'unsafe {\|unsafe fn' . | wc -l 1937 With rust/library/ (and libc, and winapi-rs): $ grep -irn 'unsafe {\|unsafe fn' . | wc -l 5612