@@ -110,7 +110,7 @@ impl From<crate::event::Error> for Error {
110
110
}
111
111
112
112
/// Marker
113
- #[ derive( Debug , Clone , Eq , PartialEq , Ord , PartialOrd ) ]
113
+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
114
114
pub enum Marker {
115
115
/// Root
116
116
Root ,
@@ -145,7 +145,7 @@ where
145
145
}
146
146
147
147
/// Report
148
- #[ derive( Debug , Clone , Eq , PartialEq , Ord , PartialOrd ) ]
148
+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
149
149
pub enum Report {
150
150
/// Depictions of nudity, porn, etc
151
151
Nudity ,
@@ -188,7 +188,7 @@ impl TryFrom<&str> for Report {
188
188
}
189
189
190
190
/// Tag kind
191
- #[ derive( Debug , Clone , Eq , PartialEq , Ord , PartialOrd ) ]
191
+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
192
192
pub enum TagKind {
193
193
/// Public key
194
194
P ,
@@ -319,7 +319,7 @@ where
319
319
}
320
320
321
321
#[ allow( missing_docs) ]
322
- #[ derive( Debug , Clone , Eq , PartialEq , PartialOrd , Ord ) ]
322
+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
323
323
pub enum Tag {
324
324
Generic ( TagKind , Vec < String > ) ,
325
325
Event ( EventId , Option < UncheckedUrl > , Option < Marker > ) ,
@@ -499,7 +499,7 @@ where
499
499
TagKind :: P => {
500
500
let pubkey = XOnlyPublicKey :: from_str ( & tag[ 1 ] ) ?;
501
501
if tag[ 2 ] . is_empty ( ) {
502
- Ok ( Self :: PubKey ( pubkey, Some ( UncheckedUrl :: default ( ) ) ) )
502
+ Ok ( Self :: PubKey ( pubkey, Some ( UncheckedUrl :: empty ( ) ) ) )
503
503
} else {
504
504
match Report :: try_from ( tag[ 2 ] . as_str ( ) ) {
505
505
Ok ( report) => Ok ( Self :: PubKeyReport ( pubkey, report) ) ,
@@ -513,7 +513,7 @@ where
513
513
TagKind :: E => {
514
514
let event_id = EventId :: from_hex ( & tag[ 1 ] ) ?;
515
515
if tag[ 2 ] . is_empty ( ) {
516
- Ok ( Self :: Event ( event_id, Some ( UncheckedUrl :: default ( ) ) , None ) )
516
+ Ok ( Self :: Event ( event_id, Some ( UncheckedUrl :: empty ( ) ) , None ) )
517
517
} else {
518
518
match Report :: try_from ( tag[ 2 ] . as_str ( ) ) {
519
519
Ok ( report) => Ok ( Self :: EventReport ( event_id, report) ) ,
@@ -895,7 +895,7 @@ mod tests {
895
895
EventId :: from_hex(
896
896
"378f145897eea948952674269945e88612420db35791784abf0616b4fed56ef7"
897
897
) ?,
898
- Some ( UncheckedUrl :: default ( ) ) ,
898
+ Some ( UncheckedUrl :: empty ( ) ) ,
899
899
None
900
900
)
901
901
. as_vec( )
@@ -1121,7 +1121,7 @@ mod tests {
1121
1121
EventId :: from_hex(
1122
1122
"378f145897eea948952674269945e88612420db35791784abf0616b4fed56ef7"
1123
1123
) ?,
1124
- Some ( UncheckedUrl :: default ( ) ) ,
1124
+ Some ( UncheckedUrl :: empty ( ) ) ,
1125
1125
None
1126
1126
)
1127
1127
) ;
0 commit comments