We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently the signature of EventData::json looks like this:
EventData::json
pub fn json<S, P>(event_type: S, payload: P) -> serde_json::Result<EventData>
The payload is later only used by shared reference, there is no need for an owned value:
payload
let payload = Bytes::from(serde_json::to_vec(&payload)?);
Therefore the signature could be changed (notice &P instead of P):
&P
P
pub fn json<S, P>(event_type: S, payload: &P) -> serde_json::Result<EventData>
This would avoid cloning the event in cases where it is needed after invoking EventData::json.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently the signature of
EventData::json
looks like this:The
payload
is later only used by shared reference, there is no need for an owned value:Therefore the signature could be changed (notice
&P
instead ofP
):This would avoid cloning the event in cases where it is needed after invoking
EventData::json
.The text was updated successfully, but these errors were encountered: