@@ -90,9 +90,9 @@ impl InitialData {
90
90
}
91
91
92
92
/// Create some initial data representing some JSON.
93
- pub fn from_json ( json : serde_json:: Value ) -> Result < Self , ConvertToError > {
93
+ pub fn from_json ( json : & serde_json:: Value ) -> Result < Self , ConvertToError > {
94
94
Ok ( Self {
95
- data : serde_json:: to_vec ( & json) . map_err ( |err| ConvertToError :: InvalidJson { err } ) ?,
95
+ data : serde_json:: to_vec ( json) . map_err ( |err| ConvertToError :: InvalidJson { err } ) ?,
96
96
} )
97
97
}
98
98
}
@@ -215,7 +215,7 @@ pub struct StreamPacket<J = ()> {
215
215
}
216
216
217
217
impl < J > StreamPacket < J > {
218
- /// Create a StreamPacket representing a `Frame`.
218
+ /// Create a ` StreamPacket` representing a `Frame`.
219
219
pub fn from_frame ( frame : data:: CheckedFrame < ' _ > ) -> Result < Self , ConvertToError > {
220
220
Ok ( Self {
221
221
data : frame
@@ -225,7 +225,7 @@ impl<J> StreamPacket<J> {
225
225
} )
226
226
}
227
227
228
- /// Create a StreamPacket representing some JSON.
228
+ /// Create a ` StreamPacket` representing some JSON.
229
229
pub fn from_json ( json : & J ) -> Result < Self , ConvertToError >
230
230
where
231
231
J : Serialize ,
@@ -236,7 +236,7 @@ impl<J> StreamPacket<J> {
236
236
} )
237
237
}
238
238
239
- /// Create a StreamPacket from arbitrary bytes.
239
+ /// Create a ` StreamPacket` from arbitrary bytes.
240
240
pub fn from_bytes ( data : Vec < u8 > ) -> Self {
241
241
Self {
242
242
data,
0 commit comments