File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 4444- Add NIP-C7 support (https://github.com/rust-nostr/nostr/pull/1067 )
4545- Add NIP-60 support (https://github.com/rust-nostr/nostr/pull/1092 )
4646- Implement ` ToBech32 ` trait for ` Nip21 `
47+ - Implement ` From<&Event> ` for ` Nip19Event `
4748- Add ` CowTag::kind ` and ` CowTag::content `
4849- Add ` Timestamp::as_secs `
4950- Add ` Kind::CashuNutZapInfo ` (10019) and ` Kind::CashuNutZap ` (9321) variants
7475### Deprecated
7576
7677- Deprecate ` Timestamp::as_u64 `
78+ - Deprecate ` Nip19Event::from_event `
7779- Deprecate ` kind ` field in ` CommentTarget::Coordinate ` variant (https://github.com/rust-nostr/nostr/pull/1035 )
7880
7981### Breaking changes
Original file line number Diff line number Diff line change @@ -397,8 +397,9 @@ impl Nip19Event {
397397 }
398398
399399 /// Construct new NIP19 event from [`Event`].
400+ #[ deprecated( since = "0.44.0" , note = "Use `from` instead." ) ]
400401 pub fn from_event ( event : & Event ) -> Self {
401- Self :: new ( event. id ) . author ( event . pubkey ) . kind ( event . kind )
402+ Self :: from ( event)
402403 }
403404
404405 /// Add author
@@ -481,6 +482,12 @@ impl Nip19Event {
481482 }
482483}
483484
485+ impl From < & Event > for Nip19Event {
486+ fn from ( event : & Event ) -> Self {
487+ Self :: new ( event. id ) . author ( event. pubkey ) . kind ( event. kind )
488+ }
489+ }
490+
484491impl FromBech32 for Nip19Event {
485492 type Err = Error ;
486493
You can’t perform that action at this time.
0 commit comments