The closure may not be called if resolution could not be performed
This function strives to never panic.
So we should ideally not panic and instead simply return without calling the closure. Therefore, I've changed the panicky FFI calls to instead simply return.
I also replaced our custom UTF-16 to UTF-8 converter with a call to WideCharToMultiByte. This function already has the semantics we want and doesn't include panicking code.
These changes should have a small but notable effect on binary size.
According to the docs for
resolve
:So we should ideally not panic and instead simply return without calling the closure. Therefore, I've changed the panicky FFI calls to instead simply return.
I also replaced our custom UTF-16 to UTF-8 converter with a call to
WideCharToMultiByte
. This function already has the semantics we want and doesn't include panicking code.These changes should have a small but notable effect on binary size.