nit: `to_unsafe_ptr` is unnecessary