Fix clippy warnings

This commit is contained in:
Jonas Platte 2021-10-19 22:15:59 +02:00
parent 0e49b70d65
commit 401c0b07b3
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
3 changed files with 4 additions and 2 deletions

View File

@ -40,6 +40,7 @@ impl Serialize for Relation {
where where
S: Serializer, S: Serializer,
{ {
#[allow(clippy::needless_update)]
let relates_to = match self { let relates_to = match self {
#[cfg(feature = "unstable-pre-spec")] #[cfg(feature = "unstable-pre-spec")]
Relation::Annotation(r) => RelatesToJsonRepr { Relation::Annotation(r) => RelatesToJsonRepr {

View File

@ -43,6 +43,7 @@ impl Serialize for Relation {
where where
S: Serializer, S: Serializer,
{ {
#[allow(clippy::needless_update)]
let json_repr = match self { let json_repr = match self {
Relation::Reply { in_reply_to } => EventWithRelatesToJsonRepr::new(RelatesToJsonRepr { Relation::Reply { in_reply_to } => EventWithRelatesToJsonRepr::new(RelatesToJsonRepr {
in_reply_to: Some(in_reply_to.clone()), in_reply_to: Some(in_reply_to.clone()),

View File

@ -55,7 +55,7 @@ fn serialize_pdu_as_v1() {
"event_id": "$somejoinevent:matrix.org", "event_id": "$somejoinevent:matrix.org",
"sender": "@sender:example.com", "sender": "@sender:example.com",
"origin": "matrix.org", "origin": "matrix.org",
"origin_server_ts": 1_592_050_773_658u64, "origin_server_ts": 1_592_050_773_658_u64,
"type": "m.room.power_levels", "type": "m.room.power_levels",
"content": { "content": {
"testing": 123 "testing": 123
@ -114,7 +114,7 @@ fn serialize_pdu_as_v3() {
"room_id": "!n8f893n9:example.com", "room_id": "!n8f893n9:example.com",
"sender": "@sender:example.com", "sender": "@sender:example.com",
"origin": "matrix.org", "origin": "matrix.org",
"origin_server_ts": 1_592_050_773_658u64, "origin_server_ts": 1_592_050_773_658_u64,
"type": "m.room.power_levels", "type": "m.room.power_levels",
"content": { "content": {
"testing": 123 "testing": 123