events: Implement Default for InitialStateEvent
… where C has an empty state key and implements Default itself.
This commit is contained in:
parent
d56386a636
commit
4049969d8c
@ -349,6 +349,15 @@ impl<C: StaticStateEventContent> InitialStateEvent<C> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<C> Default for InitialStateEvent<C>
|
||||||
|
where
|
||||||
|
C: StaticStateEventContent<StateKey = EmptyStateKey> + Default,
|
||||||
|
{
|
||||||
|
fn default() -> Self {
|
||||||
|
Self { content: Default::default(), state_key: EmptyStateKey }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<C: StaticStateEventContent> Serialize for InitialStateEvent<C> {
|
impl<C: StaticStateEventContent> Serialize for InitialStateEvent<C> {
|
||||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
where
|
where
|
||||||
|
Loading…
x
Reference in New Issue
Block a user