mirror of
https://github.com/bevyengine/bevy.git
synced 2026-07-03 09:13:55 -04:00
96e198e1e4
# Objective
Bevy remote's `BrpResponse` derives `serde::Deserialize`, but the static
lifetime prevents it from actually being so:
```
let response: BrpResponse = serde_json::from_str(&response)?;
---------------------^^^^^^^^^-
| |
| borrowed value does not live long enough
argument requires that `response` is borrowed for `'static`
```
No migration guide needed, since the interface for `BrpResponse::new`
used by downstream implementers remains unchanged.
## Solution
Remove the `jsonrpc` field by writing a custom `impl` for `Serialize` &
`Deserialize`, which is the same solution as done previously in #23175.
## Testing
This change has a very low impact. Tests pass.
## Alternatives
1. Replace jsonrpc with `String`
2. Replace jsonrpc with `Cow`
---------
Co-authored-by: Mira <specificprotagonist@posteo.org>