Skip to content

Commit

Permalink
Prettify JSON data.
Browse files Browse the repository at this point in the history
  • Loading branch information
gfriloux committed Mar 29, 2018
1 parent 669cf6b commit 8b623b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<T: DeserializeOwned> FromData for Json<T> {
/// fails, an `Err` of `Status::InternalServerError` is returned.
impl<T: Serialize> Responder<'static> for Json<T> {
fn respond_to(self, req: &Request) -> response::Result<'static> {
serde_json::to_string(&self.0).map(|string| {
serde_json::to_string_pretty(&self.0).map(|string| {
content::Json(string).respond_to(req).unwrap()
}).map_err(|e| {
error_!("JSON failed to serialize: {:?}", e);
Expand Down

0 comments on commit 8b623b2

Please sign in to comment.