initial real data rendering working
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::{Error, Result};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
/// Event is the struct used to represent a Nostr event
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
@@ -22,6 +23,13 @@ pub struct Event {
|
||||
pub sig: String,
|
||||
}
|
||||
|
||||
// Implement Hash trait
|
||||
impl Hash for Event {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
self.id.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for Event {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.id == other.id
|
||||
|
||||
Reference in New Issue
Block a user