Update js_int, serde_json

This commit is contained in:
Jonas Platte 2020-04-28 14:43:02 +02:00
parent 037a4faa6e
commit 9fe1b3f190
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 3 additions and 4 deletions

View File

@ -13,12 +13,12 @@ version = "0.21.0-beta.1"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
js_int = { version = "0.1.4", features = ["serde"] } js_int = { version = "0.1.5", features = ["serde"] }
ruma-events-macros = { path = "ruma-events-macros", version = "=0.21.0-beta.1" } ruma-events-macros = { path = "ruma-events-macros", version = "=0.21.0-beta.1" }
ruma-identifiers = "0.16.0" ruma-identifiers = "0.16.0"
ruma-serde = "0.1.0" ruma-serde = "0.1.0"
serde = { version = "1.0.106", features = ["derive"] } serde = { version = "1.0.106", features = ["derive"] }
serde_json = { version = "1.0.51", features = ["raw_value"] } serde_json = { version = "1.0.52", features = ["raw_value"] }
[dev-dependencies] [dev-dependencies]
maplit = "1.0.2" maplit = "1.0.2"

View File

@ -62,8 +62,7 @@ impl<T: TryFromRaw> EventJson<T> {
impl<T: Serialize> From<&T> for EventJson<T> { impl<T: Serialize> From<&T> for EventJson<T> {
fn from(val: &T) -> Self { fn from(val: &T) -> Self {
let json_string = serde_json::to_string(&val).unwrap(); Self::new(serde_json::value::to_raw_value(val).unwrap())
Self::new(RawValue::from_string(json_string).unwrap())
} }
} }