Rename FFI error types to avoid naming conflicts#830
Rename FFI error types to avoid naming conflicts#830spacebear21 merged 2 commits intopayjoin:masterfrom
Conversation
Pull Request Test Coverage Report for Build 16005924185Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
This looks great! Would it make sense to add a brief note in the type doc comments that these names are shaped partly by FFI constraints? might help future contributors understand the reason behind choices like |
arminsabouri
left a comment
There was a problem hiding this comment.
CodeACK. Justification for code change makes sense to me.
Small typos in the commit message
- is areserved => are reserved
- importedas
| pub fn save<P>(&self, persister: &P) -> Result<InitializedTransitionOutcome, ReceiverPersistedError> | ||
| pub fn save<P>( | ||
| &self, | ||
| persister: &P, | ||
| ) -> Result<InitializedTransitionOutcome, ReceiverPersistedError> |
There was a problem hiding this comment.
Non blocking error. Just noticed that this is a pure fmt change. Probably bc we dont run fmt --check on ci for this crate.
The name `Error` causes conflicts in other languages where `Error` is a reserved keyword. And since uniffi doesn't support namespacing per mozilla/uniffi-rs#1849, this would be imported as `payjoin::Error` for implementers downstream, which is ambiguous. Renaming to `ReceiverError` fixes both of these issues.
"Error" gets replaced by "Exception" in uniffi-dart to respect dart conventions, causing issues. Since this isn't a struct native to rust-payjoin and not an actual `Error`, the easy fix is to rename it.
8719b70 to
dd70c9f
Compare
|
Corrected the typos, thanks! |
The first commit renames receive::Error to ReceiverError to avoid conflicts in languages where Error is a reserved keyword.
The second commit renames TerminalError to TerminalErr as a workaround to a quirk in uniffi-dart (see commit message for more detail)