chore(types,blahd): fix clippy warnings

This commit is contained in:
oxalica 2025-09-11 17:46:16 -04:00
parent b97ce5f29c
commit 401618c129
2 changed files with 12 additions and 12 deletions

View file

@ -51,11 +51,11 @@ impl UserIdentityDesc {
/// Validate signatures of the identity description at given time. /// Validate signatures of the identity description at given time.
pub fn verify(&self, id_url: Option<&IdUrl>, now_timestamp: u64) -> Result<(), VerifyError> { pub fn verify(&self, id_url: Option<&IdUrl>, now_timestamp: u64) -> Result<(), VerifyError> {
if let Some(id_url) = id_url { if let Some(id_url) = id_url
if !self.profile.signee.payload.id_urls.contains(id_url) { && !self.profile.signee.payload.id_urls.contains(id_url)
{
return Err(VerifyErrorImpl::MissingIdUrl.into()); return Err(VerifyErrorImpl::MissingIdUrl.into());
} }
}
if self.id_key != self.profile.signee.user.id_key { if self.id_key != self.profile.signee.user.id_key {
return Err(VerifyErrorImpl::ProfileIdKeyMismatch.into()); return Err(VerifyErrorImpl::ProfileIdKeyMismatch.into());
} }

View file

@ -63,12 +63,12 @@ impl State {
let mut cnt = 0usize; let mut cnt = 0usize;
let msg = Arc::new(ServerEvent::Msg(msg)); let msg = Arc::new(ServerEvent::Msg(msg));
for uid in &room_members { for uid in &room_members {
if let Some(tx) = listeners.get(uid) { if let Some(tx) = listeners.get(uid)
if tx.send(msg.clone()).is_ok() { && tx.send(msg.clone()).is_ok()
{
cnt += 1; cnt += 1;
} }
} }
}
if cnt != 0 { if cnt != 0 {
tracing::debug!("broadcasted event to {cnt} clients"); tracing::debug!("broadcasted event to {cnt} clients");
} }
@ -119,13 +119,13 @@ impl Drop for UserEventReceiver {
fn drop(&mut self) { fn drop(&mut self) {
tracing::debug!(%self.uid, "user disconnected"); tracing::debug!(%self.uid, "user disconnected");
let mut map = self.st.event.user_listeners.lock(); let mut map = self.st.event.user_listeners.lock();
if let Some(tx) = map.get_mut(&self.uid) { if let Some(tx) = map.get_mut(&self.uid)
if tx.receiver_count() == 1 { && tx.receiver_count() == 1
{
map.remove(&self.uid); map.remove(&self.uid);
} }
} }
} }
}
impl Stream for UserEventReceiver { impl Stream for UserEventReceiver {
type Item = Result<Arc<ServerEvent>, BroadcastStreamRecvError>; type Item = Result<Arc<ServerEvent>, BroadcastStreamRecvError>;