apply new rustfmt.toml changes, fix some clippy lints

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-12-15 00:05:47 -05:00
parent 0317cc8cc5
commit 77e0b76408
No known key found for this signature in database
296 changed files with 7147 additions and 4300 deletions

View file

@ -21,7 +21,10 @@ pub(super) struct Presence {
impl Presence {
#[must_use]
pub(super) fn new(
state: PresenceState, currently_active: bool, last_active_ts: u64, status_msg: Option<String>,
state: PresenceState,
currently_active: bool,
last_active_ts: u64,
status_msg: Option<String>,
) -> Self {
Self {
state,
@ -32,11 +35,16 @@ impl Presence {
}
pub(super) fn from_json_bytes(bytes: &[u8]) -> Result<Self> {
serde_json::from_slice(bytes).map_err(|_| Error::bad_database("Invalid presence data in database"))
serde_json::from_slice(bytes)
.map_err(|_| Error::bad_database("Invalid presence data in database"))
}
/// Creates a PresenceEvent from available data.
pub(super) async fn to_presence_event(&self, user_id: &UserId, users: &users::Service) -> PresenceEvent {
pub(super) async fn to_presence_event(
&self,
user_id: &UserId,
users: &users::Service,
) -> PresenceEvent {
let now = utils::millis_since_unix_epoch();
let last_active_ago = if self.currently_active {
None