From 206a824f3e959ce69f1559d33a63509ef3f39bd9 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sat, 9 May 2020 15:41:34 +0200 Subject: [PATCH] Add EventJson::into_json --- CHANGELOG.md | 6 ++++++ Cargo.toml | 6 +++--- ruma-events-macros/Cargo.toml | 6 +++--- src/json.rs | 7 ++++++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e77ad9f..ccba68b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # [unreleased] +# 0.21.1 + +Improvements: + +* Add `EventJson::into_json` + # 0.21.0 Breaking changes: diff --git a/Cargo.toml b/Cargo.toml index c5bb3492..2d9b4d70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,16 +9,16 @@ license = "MIT" name = "ruma-events" readme = "README.md" repository = "https://github.com/ruma/ruma-events" -version = "0.21.0" +version = "0.21.1" edition = "2018" [dependencies] js_int = { version = "0.1.5", features = ["serde"] } ruma-common = "0.1.1" -ruma-events-macros = { path = "ruma-events-macros", version = "=0.21.0" } +ruma-events-macros = { path = "ruma-events-macros", version = "=0.21.1" } ruma-identifiers = "0.16.1" ruma-serde = "0.1.3" -serde = { version = "1.0.106", features = ["derive"] } +serde = { version = "1.0.107", features = ["derive"] } serde_json = { version = "1.0.52", features = ["raw_value"] } [dev-dependencies] diff --git a/ruma-events-macros/Cargo.toml b/ruma-events-macros/Cargo.toml index a3462db7..eae7dd11 100644 --- a/ruma-events-macros/Cargo.toml +++ b/ruma-events-macros/Cargo.toml @@ -10,10 +10,10 @@ license = "MIT" name = "ruma-events-macros" readme = "README.md" repository = "https://github.com/ruma/ruma-api-macros" -version = "0.21.0" +version = "0.21.1" [dependencies] -syn = { version = "1.0.18", features = ["full"] } +syn = { version = "1.0.19", features = ["full"] } quote = "1.0.4" proc-macro2 = "1.0.12" @@ -24,4 +24,4 @@ proc-macro = true ruma-identifiers = "0.16.1" serde_json = "1.0.52" js_int = { version = "0.1.5", features = ["serde"] } -serde = { version = "1.0.106", features = ["derive"] } +serde = { version = "1.0.107", features = ["derive"] } diff --git a/src/json.rs b/src/json.rs index e9a7f729..8a433959 100644 --- a/src/json.rs +++ b/src/json.rs @@ -31,10 +31,15 @@ impl EventJson { } } - /// Access the underlying `RawValue`. + /// Access the underlying json value. pub fn json(&self) -> &RawValue { &self.json } + + /// Convert `self` into the underlying json value. + pub fn into_json(self) -> Box { + self.json + } } impl EventJson {