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

rpc_module: remove expect in fn call #774

Merged
merged 1 commit into from
May 19, 2022

Conversation

niklasad1
Copy link
Member

This method is mainly used for testing but the expect there was bad and confusing which this fixes.

See #773 for further information.

@niklasad1 niklasad1 requested a review from a team as a code owner May 18, 2022 12:42
}

unreachable!("Invalid JSON-RPC response is not possible using jsonrpsee; this is bug please file an issue");
let res = match serde_json::from_str::<Response<T>>(&resp) {
Copy link
Member

Choose a reason for hiding this comment

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

Clean change 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

just annoying to have to do that let res binding but otherwise rustc complains about the lifetime issues FYI

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's strange; I would have expected you could return the match immediately!

Copy link
Member Author

Choose a reason for hiding this comment

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

me too but might confuse rustc that resp is borrowed twice ^^

@niklasad1 niklasad1 merged commit f3a3603 into master May 19, 2022
@niklasad1 niklasad1 deleted the na-fix-bad-err-rpc-module-call branch May 19, 2022 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants