Remove various Box<> wrappers

This commit is contained in:
Jonathan de Jong 2021-05-10 15:15:11 +00:00 committed by GitHub
parent d71fa97346
commit 91a7325bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ ruma_api! {
///
/// To create a `RawJsonValue`, use `serde_json::value::to_raw_value`.
#[ruma_api(body)]
pub data: Box<RawJsonValue>,
pub data: &'a RawJsonValue,
/// The event type of the account_data to set.
///
@ -47,7 +47,7 @@ ruma_api! {
impl<'a> Request<'a> {
/// Creates a new `Request` with the given data, event type, room ID and user ID.
pub fn new(
data: Box<RawJsonValue>,
data: &'a RawJsonValue,
event_type: &'a str,
room_id: &'a RoomId,
user_id: &'a UserId,

View File

@ -34,7 +34,7 @@ ruma_api! {
/// The content's type for this field will be updated in a future
/// release, until then you can create a value using
/// `serde_json::value::to_raw_value`.
pub messages: BTreeMap<UserId, BTreeMap<DeviceIdOrAllDevices, Box<RawJsonValue>>>
pub messages: BTreeMap<UserId, BTreeMap<DeviceIdOrAllDevices, Box<RawJsonValue>>>,
}
#[derive(Default)]

View File

@ -112,7 +112,7 @@ pub struct Notification<'a> {
/// The `content` field from the event, if present. The pusher may omit this
/// if the event had no content or for any other reason.
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<Box<RawJsonValue>>,
pub content: Option<&'a RawJsonValue>,
/// This is a dictionary of the current number of unacknowledged
/// communications for the recipient user. Counts whose value is zero should