Update json literal formatting

This commit is contained in:
Jonas Platte 2020-05-02 11:10:31 +02:00
parent 8e4ff82a83
commit f23d7414ec
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
5 changed files with 10 additions and 9 deletions

View File

@ -453,10 +453,11 @@ mod tests {
#[test]
fn deserialization_structure_mismatch() {
// Missing several required fields.
let error = from_json_value::<EventJson<StartEventContent>>(json!({"from_device": "123"}))
.unwrap()
.deserialize()
.unwrap_err();
let error =
from_json_value::<EventJson<StartEventContent>>(json!({ "from_device": "123" }))
.unwrap()
.deserialize()
.unwrap_err();
assert!(error.message().contains("missing field"));
assert!(error.is_deserialization());

View File

@ -487,7 +487,7 @@ mod tests {
fn serialize_contains_display_name_condition() {
assert_eq!(
to_json_value(&PushCondition::ContainsDisplayName).unwrap(),
json!({"kind": "contains_display_name"})
json!({ "kind": "contains_display_name" })
);
}
@ -540,7 +540,7 @@ mod tests {
#[test]
fn deserialize_contains_display_name_condition() {
assert_matches!(
from_json_value::<PushCondition>(json!({"kind": "contains_display_name"})).unwrap(),
from_json_value::<PushCondition>(json!({ "kind": "contains_display_name" })).unwrap(),
PushCondition::ContainsDisplayName
);
}

View File

@ -329,7 +329,7 @@ mod tests {
#[test]
fn deserialization_failure() {
assert!(from_json_value::<EventJson<EncryptedEventContent>>(
json!({"algorithm": "m.megolm.v1.aes-sha2"})
json!({ "algorithm": "m.megolm.v1.aes-sha2" })
)
.unwrap()
.deserialize()

View File

@ -222,7 +222,7 @@ mod tests {
},
"event_id": "$h29iv0s8:example.com",
"origin_server_ts": 1,
"prev_content": {"name": "The old name"},
"prev_content": { "name": "The old name" },
"room_id": "!n8f893n9:example.com",
"sender": "@carl:example.com",
"state_key": "",

View File

@ -351,7 +351,7 @@ mod tests {
"type": "m.room.name",
"state_key": "",
"sender": "@example:localhost",
"content": {"name": "Ruma"}
"content": { "name": "Ruma" }
});
let join_rules_event = json!({