Remove unused imports and fix serde::ser::Error trait not being in scope
This commit is contained in:
parent
800fba7c32
commit
d38e385aab
@ -48,7 +48,7 @@ pub fn expand_event(input: DeriveInput) -> syn::Result<TokenStream> {
|
||||
let time_since_epoch =
|
||||
self.origin_server_ts.duration_since(::std::time::UNIX_EPOCH).unwrap();
|
||||
|
||||
let timestamp = ::js_int::UInt::try_from(time_since_epoch.as_millis())
|
||||
let timestamp = <::js_int::UInt as ::std::convert::TryFrom<_>>::try_from(time_since_epoch.as_millis())
|
||||
.map_err(S::Error::custom)?;
|
||||
|
||||
state.serialize_field("origin_server_ts", ×tamp)?;
|
||||
@ -81,7 +81,7 @@ pub fn expand_event(input: DeriveInput) -> syn::Result<TokenStream> {
|
||||
where
|
||||
S: ::serde::ser::Serializer,
|
||||
{
|
||||
use ::serde::ser::SerializeStruct as _;
|
||||
use ::serde::ser::{SerializeStruct as _, Error as _};
|
||||
|
||||
let event_type = #event_ty;
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
use std::{convert::TryFrom, time::SystemTime};
|
||||
use std::time::SystemTime;
|
||||
|
||||
use ruma_events_macros::Event;
|
||||
use ruma_identifiers::{EventId, RoomId, UserId};
|
||||
use serde::ser::Error;
|
||||
|
||||
use crate::{
|
||||
BasicEventContent, EphemeralRoomEventContent, MessageEventContent, StateEventContent,
|
||||
|
@ -3,7 +3,7 @@
|
||||
use std::{collections::BTreeMap, time::SystemTime};
|
||||
|
||||
use ruma_events_macros::EphemeralRoomEventContent;
|
||||
use ruma_identifiers::{EventId, RoomId, UserId};
|
||||
use ruma_identifiers::{EventId, UserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Informs the client who has read a message specified by it's event id.
|
||||
|
@ -1,14 +1,11 @@
|
||||
//! Types for the *m.room.message* event.
|
||||
|
||||
use std::time::SystemTime;
|
||||
|
||||
use js_int::UInt;
|
||||
use ruma_events_macros::MessageEventContent;
|
||||
use ruma_identifiers::{EventId, RoomId, UserId};
|
||||
use ruma_identifiers::EventId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::{EncryptedFile, ImageInfo, ThumbnailInfo};
|
||||
use crate::UnsignedData;
|
||||
|
||||
pub mod feedback;
|
||||
|
||||
|
@ -1,13 +1,9 @@
|
||||
//! Types for the *m.room.name* event.
|
||||
|
||||
use std::ops::Deref;
|
||||
use std::time::SystemTime;
|
||||
|
||||
use ruma_events_macros::StateEventContent;
|
||||
use ruma_identifiers::{EventId, RoomId, UserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{InvalidInput, UnsignedData};
|
||||
use crate::InvalidInput;
|
||||
|
||||
/// The payload for `NameEvent`.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, StateEventContent)]
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Types for the *m.typing* event.
|
||||
|
||||
use ruma_events_macros::EphemeralRoomEventContent;
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use ruma_identifiers::UserId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Informs the client who is currently typing in a given room.
|
||||
|
Loading…
x
Reference in New Issue
Block a user