chore: fix high cpu usage and incorrect use of list indices (#135)

* .

* fix cpu usage
This commit is contained in:
reya
2025-09-01 17:30:33 +07:00
committed by GitHub
parent b4691aa689
commit 78d913ae38
5 changed files with 111 additions and 71 deletions

View File

@@ -2,6 +2,18 @@ use std::hash::Hash;
use nostr_sdk::prelude::*;
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum Message {
User(RenderedMessage),
System,
}
impl Message {
pub fn user(user: impl Into<RenderedMessage>) -> Self {
Self::User(user.into())
}
}
#[derive(Debug, Clone)]
pub struct RenderedMessage {
pub id: EventId,