Make clippy happy
This commit is contained in:
parent
9a1c8ec66e
commit
a5c5b0b137
@ -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
|
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 {
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
@ -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
|
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user