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

Use one 🦭 per crate #1371

Merged

Conversation

workingjubilee
Copy link
Member

I discovered we had two Sealed traits inside pgrx while doing some rework, so I decided to unify them, as we don't actually need two. I also believe that the use of the pgrx::fn_call::seal::Sealed trait was incorrect: it was binding the type T, but with a blanket impl. This means downstream crates could impl FnCallArg for types other than Arg, as long as they had first implemented Clone (which they obviously can) and IntoDatum (which remains a public trait).

This didn't occur to me the first time I saw FnCallArg because I hadn't arrived at my current interpretation of what "This is only implemented for the Arg enum" was supposed to mean: This must only be implemented for the Arg enum!

I have corrected the bounds according to what I believe was intended.

I believe the intent was to prevent the trait from being implemented
outside pgrx, but that requires bounding the trait itself.
The blanket impl meant anyone could impl FnCallArg.
@workingjubilee workingjubilee changed the title Use one 🦭 per crate Use one 🦭 per crate Nov 1, 2023
@workingjubilee workingjubilee merged commit 5ef258f into pgcentralfoundation:develop Nov 1, 2023
@workingjubilee workingjubilee deleted the arf-arf-arf branch November 1, 2023 23:53
@workingjubilee
Copy link
Member Author

( very hypothetically. )

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