Skip to content

Commit

Permalink
Add impl From<Event> for UnsignedEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Mar 12, 2024
1 parent c848c02 commit c317d29
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/nostr/src/event/unsigned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,16 @@ impl UnsignedEvent {
impl JsonUtil for UnsignedEvent {
type Err = Error;
}

impl From<Event> for UnsignedEvent {
fn from(event: Event) -> Self {
Self {
id: event.id,
pubkey: event.pubkey,
created_at: event.created_at,
kind: event.kind,
tags: event.tags.clone(),
content: event.content.clone(),
}
}
}

0 comments on commit c317d29

Please sign in to comment.