File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 97
97
* nostr: impl ` FromIterator<Tag> ` for ` Tags ` ([ Yuki Kishimoto] )
98
98
* nostr: add ` EventDeletionRequest ` struct ([ Yuki Kishimoto] )
99
99
* nostr: add ` notifications ` field to NIP47 ` GetInfoResponse ` ([ Yuki Kishimoto] )
100
+ * nostr: add ` RelayMetadata::as_str ` method ([ Yuki Kishimoto] )
100
101
* database: add ` Events::force_insert ` ([ Yuki Kishimoto] )
101
102
* pool: event verification cache ([ Yuki Kishimoto] )
102
103
* pool: add ` AdmitPolicy ` trait ([ Yuki Kishimoto] )
Original file line number Diff line number Diff line change @@ -38,15 +38,22 @@ pub enum RelayMetadata {
38
38
Write ,
39
39
}
40
40
41
- impl fmt:: Display for RelayMetadata {
42
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
41
+ impl RelayMetadata {
42
+ /// Get as `&str`.
43
+ pub fn as_str ( & self ) -> & str {
43
44
match self {
44
- Self :: Read => write ! ( f , "read" ) ,
45
- Self :: Write => write ! ( f , "write" ) ,
45
+ Self :: Read => "read" ,
46
+ Self :: Write => "write" ,
46
47
}
47
48
}
48
49
}
49
50
51
+ impl fmt:: Display for RelayMetadata {
52
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
53
+ write ! ( f, "{}" , self . as_str( ) )
54
+ }
55
+ }
56
+
50
57
impl FromStr for RelayMetadata {
51
58
type Err = Error ;
52
59
You can’t perform that action at this time.
0 commit comments