mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-09-13 05:55:22 +00:00
chore(types,blahd): fix clippy warnings
This commit is contained in:
parent
b97ce5f29c
commit
401618c129
2 changed files with 12 additions and 12 deletions
|
@ -51,11 +51,11 @@ impl UserIdentityDesc {
|
|||
|
||||
/// Validate signatures of the identity description at given time.
|
||||
pub fn verify(&self, id_url: Option<&IdUrl>, now_timestamp: u64) -> Result<(), VerifyError> {
|
||||
if let Some(id_url) = id_url {
|
||||
if !self.profile.signee.payload.id_urls.contains(id_url) {
|
||||
if let Some(id_url) = id_url
|
||||
&& !self.profile.signee.payload.id_urls.contains(id_url)
|
||||
{
|
||||
return Err(VerifyErrorImpl::MissingIdUrl.into());
|
||||
}
|
||||
}
|
||||
if self.id_key != self.profile.signee.user.id_key {
|
||||
return Err(VerifyErrorImpl::ProfileIdKeyMismatch.into());
|
||||
}
|
||||
|
|
|
@ -63,12 +63,12 @@ impl State {
|
|||
let mut cnt = 0usize;
|
||||
let msg = Arc::new(ServerEvent::Msg(msg));
|
||||
for uid in &room_members {
|
||||
if let Some(tx) = listeners.get(uid) {
|
||||
if tx.send(msg.clone()).is_ok() {
|
||||
if let Some(tx) = listeners.get(uid)
|
||||
&& tx.send(msg.clone()).is_ok()
|
||||
{
|
||||
cnt += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if cnt != 0 {
|
||||
tracing::debug!("broadcasted event to {cnt} clients");
|
||||
}
|
||||
|
@ -119,13 +119,13 @@ impl Drop for UserEventReceiver {
|
|||
fn drop(&mut self) {
|
||||
tracing::debug!(%self.uid, "user disconnected");
|
||||
let mut map = self.st.event.user_listeners.lock();
|
||||
if let Some(tx) = map.get_mut(&self.uid) {
|
||||
if tx.receiver_count() == 1 {
|
||||
if let Some(tx) = map.get_mut(&self.uid)
|
||||
&& tx.receiver_count() == 1
|
||||
{
|
||||
map.remove(&self.uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Stream for UserEventReceiver {
|
||||
type Item = Result<Arc<ServerEvent>, BroadcastStreamRecvError>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue