Expose docstring for JSON Responder impl.

This commit is contained in:
Sergio Benitez 2017-02-16 18:06:09 -08:00
parent d8afb4c7fa
commit 6184d94619
1 changed files with 3 additions and 3 deletions

View File

@ -89,9 +89,9 @@ impl<T: Deserialize> FromData for JSON<T> {
}
}
// Serializes the wrapped value into JSON. Returns a response with Content-Type
// JSON and a fixed-size body with the serialization. If serialization fails, an
// `Err` of `Status::InternalServerError` is returned.
/// Serializes the wrapped value into JSON. Returns a response with Content-Type
/// JSON and a fixed-size body with the serialized value. If serialization
/// fails, an `Err` of `Status::InternalServerError` is returned.
impl<T: Serialize> Responder<'static> for JSON<T> {
fn respond(self) -> response::Result<'static> {
serde_json::to_string(&self.0).map(|string| {