Make clippy happy

This commit is contained in:
Jonas Platte 2022-12-09 11:09:12 +01:00
parent 9a1c8ec66e
commit a5c5b0b137
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C
4 changed files with 6 additions and 12 deletions

View File

@ -87,8 +87,7 @@ impl EventContent for RedactedRoomAliasesEventContent {
fn from_parts(event_type: &str, content: &RawJsonValue) -> serde_json::Result<Self> { fn from_parts(event_type: &str, content: &RawJsonValue) -> serde_json::Result<Self> {
if event_type != "m.room.aliases" { if event_type != "m.room.aliases" {
return Err(::serde::de::Error::custom(format!( return Err(::serde::de::Error::custom(format!(
"expected event type `m.room.aliases`, found `{}`", "expected event type `m.room.aliases`, found `{event_type}`",
event_type
))); )));
} }

View File

@ -199,8 +199,7 @@ impl EventContent for RedactedRoomMemberEventContent {
fn from_parts(event_type: &str, content: &RawJsonValue) -> serde_json::Result<Self> { fn from_parts(event_type: &str, content: &RawJsonValue) -> serde_json::Result<Self> {
if event_type != "m.room.member" { if event_type != "m.room.member" {
return Err(::serde::de::Error::custom(format!( return Err(::serde::de::Error::custom(format!(
"expected event type `m.room.member`, found `{}`", "expected event type `m.room.member`, found `{event_type}`",
event_type
))); )));
} }

View File

@ -1,5 +1,5 @@
error: valid event kinds are GlobalAccountData, RoomAccountData, EphemeralRoom, MessageLike, State, ToDevice found `NotReal` error: valid event kinds are GlobalAccountData, RoomAccountData, EphemeralRoom, MessageLike, State, ToDevice; found `NotReal`
--> $DIR/09-enum-invalid-kind.rs:4:10 --> tests/events/ui/09-enum-invalid-kind.rs:4:10
| |
4 | enum NotReal { 4 | enum NotReal {
| ^^^^^^^ | ^^^^^^^

View File

@ -138,10 +138,7 @@ impl EventKind {
| (Self::State, V::Stripped | V::Initial) => Ok(format_ident!("{var}{self}")), | (Self::State, V::Stripped | V::Initial) => Ok(format_ident!("{var}{self}")),
_ => Err(syn::Error::new( _ => Err(syn::Error::new(
Span::call_site(), Span::call_site(),
format!( format!("({self:?}, {var:?}) is not a valid event kind / variation combination"),
"({:?}, {:?}) is not a valid event kind / variation combination",
self, var
),
)), )),
} }
} }
@ -175,8 +172,7 @@ impl Parse for EventKind {
ident, ident,
format!( format!(
"valid event kinds are GlobalAccountData, RoomAccountData, EphemeralRoom, \ "valid event kinds are GlobalAccountData, RoomAccountData, EphemeralRoom, \
MessageLike, State, ToDevice found `{}`", MessageLike, State, ToDevice; found `{id}`",
id
), ),
)); ));
} }