Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use NonNull in datum::Array #656

Merged
merged 3 commits into from
Aug 26, 2022

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Aug 26, 2022

This removes a small but, IMO, pointless panic! in our exposed call surface. It is not unsafe to return the null pointer. That's why ptr::null() is safe to call. panic! should be used to avoid unsafe or invalid conditions, not just undesirable ones.

This also begins the deprecation process for Array::over.

This allows removing the Options from the NonNull ptrs internally,
which will make the result more sound in the long run.
Comment on lines 96 to 97
elements: *mut pg_sys::Datum,
nulls: *mut bool,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are being kept as-is for the moment because the actual fix for them is using the new RawArray abstraction plus bitvec to handle things, removing usage of deconstruct_array, and that's a more complex followup.

@workingjubilee workingjubilee merged commit 559da11 into develop Aug 26, 2022
@workingjubilee workingjubilee mentioned this pull request Aug 26, 2022
14 tasks
@eeeebbbbrrrr eeeebbbbrrrr deleted the dont-panic-into-arraytype branch June 20, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants