Lurker News

Comments (476) 68 threads

Show all comments

Showing thread 51 of 68

sdegutis2 replies#
How much unsafe code was needed to make this work?
jwilm1 reply#
As Steve mentioned, it was mostly for ffi. There's also a few places where I'm doing my own bounds checking in order to provide nicer error messages. After doing the bounds checking, doing an index operation without the standard library's bounds checking requires unsafe.
steveklabnik1 reply#
Couldn't you use get instead of [] for this?

Maybe I'll look into it and send a PR :)

jwilm1 reply#
That seems completely reasonable. Not sure why I didn't consider it. PRs welcome :D
steveklabnik#
I figured out why: because there are two of them, it's a little awkward... I might have a PR for you, we'll see :)