Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion axum-extra/src/response/erased_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ impl ErasedJson {
pub fn pretty<T: Serialize>(val: T) -> Self {
let mut bytes = BytesMut::with_capacity(128);
let result = match serde_json::to_writer_pretty((&mut bytes).writer(), &val) {
Ok(()) => Ok(bytes.freeze()),
Ok(()) => {
bytes.put_u8(b'\n');
Ok(bytes.freeze())
}
Err(e) => Err(Arc::new(e)),
};
Self(result)
Expand Down
Loading