From 5071e8b298fe51f87e7d8de64052a1ecfe46b8e2 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 17 Oct 2023 10:03:52 -0700 Subject: [PATCH] use to_raw_value instead of to_string --- web3_proxy/src/response_cache.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web3_proxy/src/response_cache.rs b/web3_proxy/src/response_cache.rs index 50b75e6a..22ead5e7 100644 --- a/web3_proxy/src/response_cache.rs +++ b/web3_proxy/src/response_cache.rs @@ -11,7 +11,7 @@ use ethers::{ }; use hashbrown::hash_map::DefaultHashBuilder; use moka::future::Cache; -use serde_json::value::RawValue; +use serde_json::value::{to_raw_value, RawValue}; use std::{ hash::{BuildHasher, Hash, Hasher}, sync::Arc, @@ -184,7 +184,7 @@ impl TryFrom> for ForwardedResponse for ForwardedResponse> { fn from(value: serde_json::Value) -> Self { - let value = RawValue::from_string(value.to_string()).unwrap(); + let value = to_raw_value(&value).unwrap(); value.into() }