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

Rename ErrorReportable::report() to unwrap_or_report() #1568

Merged

Conversation

NotGyro
Copy link
Contributor

@NotGyro NotGyro commented Feb 20, 2024

As noted in #1561, pgrx::pg_sys::panics::ErrorReportable::report() is named identically to std::process::Termination::report(), and they are both traits that are implemented on Result<T, E> so if you import both traits you'll have a name collision. Aside from the name collision, it's very easy to see .report() called on a Result type and make the incorrect assumption this is the Termination trait when one is unfamiliar with PGRX's codebase.

To avoid ambiguity, this set of changes renames that method to unwrap_or_report(), and is intended to be included in the set of breaking changes for 0.12.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

This looks great! (assuming CI also approves)

Just to remind though, we have the best versioning scheme: https://0ver.org/

@workingjubilee workingjubilee changed the title Rename ErrorReportable::report() to unwrap_or_report(), to avoid ambiguity Rename ErrorReportable::report() to unwrap_or_report() Feb 20, 2024
@workingjubilee workingjubilee merged commit a05603f into pgcentralfoundation:develop Feb 20, 2024
11 checks passed
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