Use only 'Request' parameter in content_types example catcher.

This commit is contained in:
Sergio Benitez 2017-01-31 02:46:28 -08:00
parent 374593c2f0
commit 52d627cf44
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ extern crate serde_derive;
#[cfg(test)]
mod tests;
use rocket::{Request, Error};
use rocket::Request;
use rocket::http::ContentType;
use rocket::response::content;
@ -33,7 +33,7 @@ fn hello(content_type: ContentType, name: String, age: i8) -> content::JSON<Stri
}
#[error(404)]
fn not_found(_: Error, request: &Request) -> content::HTML<String> {
fn not_found(request: &Request) -> content::HTML<String> {
let html = if !request.content_type().is_json() {
format!("<p>This server only supports JSON requests, not '{}'.</p>",
request.content_type())