Implement display for UserStatus
This commit is contained in:
parent
3db9114ecf
commit
17194a2fcc
|
@ -8,7 +8,6 @@ use futures_util::stream::SplitStream;
|
|||
use futures_util::SinkExt;
|
||||
use futures_util::StreamExt;
|
||||
use native_tls::TlsConnector;
|
||||
use serde_json::value::RawValue;
|
||||
use std::sync::Arc;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::sync::mpsc::error::TryRecvError;
|
||||
|
|
|
@ -13,6 +13,12 @@ pub enum UserStatus {
|
|||
Invisible,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for UserStatus {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", serde_json::to_string(self).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[cfg_attr(feature = "sqlx", derive(sqlx::Type))]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
|
|
Loading…
Reference in New Issue