File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 55
55
* nostr: add missing ` payload ` arg to ` EventBuilder::job_result ` ([ Yuki Kishimoto] )
56
56
* nostr: add ` ConversationKey::new ` ([ Yuki Kishimoto] )
57
57
* nostr: add ` Request::multi_pay_invoice ` constructor ([ Yuki Kishimoto] )
58
+ * nostr: add ` Jsonutil::as_pretty_json ` and ` JsonUtil::try_as_pretty_json ` methods ([ Yuki Kishimoto] )
58
59
* pool: add ` RelayPoolNotification::Authenticated ` variant ([ Yuki Kishimoto] )
59
60
* sdk: add ` Client::gift_wrap_to ` and ` Client::send_private_msg_to ` ([ reyamir] )
60
61
* sdk: add option to autoconnect relay on ` Client::add_relay ` method call ([ Yuki Kishimoto] )
Original file line number Diff line number Diff line change @@ -60,19 +60,33 @@ where
60
60
Ok ( serde_json:: from_slice ( json. as_ref ( ) ) ?)
61
61
}
62
62
63
- /// Serialize to JSON string
63
+ /// Serialize as JSON string
64
64
///
65
65
/// This method could panic! Use `try_as_json` for error propagation.
66
66
#[ inline]
67
67
fn as_json ( & self ) -> String {
68
68
serde_json:: to_string ( self ) . unwrap ( )
69
69
}
70
70
71
- /// Serialize to JSON string
71
+ /// Serialize as JSON string
72
72
#[ inline]
73
73
fn try_as_json ( & self ) -> Result < String , Self :: Err > {
74
74
Ok ( serde_json:: to_string ( self ) ?)
75
75
}
76
+
77
+ /// Serialize as pretty JSON string
78
+ ///
79
+ /// This method could panic! Use `try_as_pretty_json` for error propagation.
80
+ #[ inline]
81
+ fn as_pretty_json ( & self ) -> String {
82
+ serde_json:: to_string_pretty ( self ) . unwrap ( )
83
+ }
84
+
85
+ /// Serialize as pretty JSON string
86
+ #[ inline]
87
+ fn try_as_pretty_json ( & self ) -> Result < String , Self :: Err > {
88
+ Ok ( serde_json:: to_string ( self ) ?)
89
+ }
76
90
}
77
91
78
92
/// Event ID or Coordinate
You can’t perform that action at this time.
0 commit comments