Skip to content

Commit

Permalink
Use 'serde_json::value::to_raw_value' in Client::call()
Browse files Browse the repository at this point in the history
  • Loading branch information
romanz committed Dec 16, 2023
1 parent 1b51e3d commit 8049ea6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1309,10 +1309,7 @@ impl RpcApi for Client {
) -> Result<T> {
let raw_args: Vec<_> = args
.iter()
.map(|a| {
let json_string = serde_json::to_string(a)?;
serde_json::value::RawValue::from_string(json_string) // we can't use to_raw_value here due to compat with Rust 1.29
})
.map(serde_json::value::to_raw_value)
.map(|a| a.map_err(|e| Error::Json(e)))
.collect::<Result<Vec<_>>>()?;
let req = self.client.build_request(&cmd, &raw_args);
Expand Down

0 comments on commit 8049ea6

Please sign in to comment.