diff --git a/core/codegen_next/tests/ui-fail/catch.rs b/core/codegen_next/tests/ui-fail/catch.rs index e50f9178..45032421 100644 --- a/core/codegen_next/tests/ui-fail/catch.rs +++ b/core/codegen_next/tests/ui-fail/catch.rs @@ -1,6 +1,6 @@ -extern crate rocket; +#[macro_use] extern crate rocket; -use rocket::{catch, Request}; +use rocket::Request; #[catch(404)] struct Catcher(String); diff --git a/core/codegen_next/tests/ui-fail/catch_type_errors.rs b/core/codegen_next/tests/ui-fail/catch_type_errors.rs index 89a37da7..c68bb867 100644 --- a/core/codegen_next/tests/ui-fail/catch_type_errors.rs +++ b/core/codegen_next/tests/ui-fail/catch_type_errors.rs @@ -1,6 +1,6 @@ -extern crate rocket; +#[macro_use] extern crate rocket; -use rocket::{catch, Request}; +use rocket::Request; #[catch(404)] fn f1(_request: &Request) -> usize { diff --git a/core/lib/src/catcher.rs b/core/lib/src/catcher.rs index b12a1d04..63cf68dc 100644 --- a/core/lib/src/catcher.rs +++ b/core/lib/src/catcher.rs @@ -38,7 +38,7 @@ use yansi::Color::*; /// /// #[macro_use] extern crate rocket; /// -/// use rocket::{catch, Request}; +/// use rocket::Request; /// /// #[catch(500)] /// fn internal_error() -> &'static str { diff --git a/core/lib/src/rocket.rs b/core/lib/src/rocket.rs index 1b1602b0..53dcdcb0 100644 --- a/core/lib/src/rocket.rs +++ b/core/lib/src/rocket.rs @@ -547,7 +547,7 @@ impl Rocket { /// /// #[macro_use] extern crate rocket; /// - /// use rocket::{catch, Request}; + /// use rocket::Request; /// /// #[catch(500)] /// fn internal_error() -> &'static str { diff --git a/core/lib/tests/redirect_from_catcher-issue-113.rs b/core/lib/tests/redirect_from_catcher-issue-113.rs index 34d9ba52..9499ca83 100644 --- a/core/lib/tests/redirect_from_catcher-issue-113.rs +++ b/core/lib/tests/redirect_from_catcher-issue-113.rs @@ -3,7 +3,7 @@ #[macro_use] extern crate rocket; -use rocket::{catch, response::Redirect}; +use rocket::response::Redirect; #[catch(404)] fn not_found() -> Redirect { diff --git a/examples/content_types/src/main.rs b/examples/content_types/src/main.rs index f2c5cabd..83c6bcdf 100644 --- a/examples/content_types/src/main.rs +++ b/examples/content_types/src/main.rs @@ -1,14 +1,13 @@ #![feature(plugin, decl_macro, proc_macro_non_items)] #![plugin(rocket_codegen)] -#[macro_use] -extern crate rocket; +#[macro_use] extern crate rocket; extern crate serde_json; #[macro_use] extern crate serde_derive; #[cfg(test)] mod tests; -use rocket::{catch, Request, response::content}; +use rocket::{Request, response::content}; #[derive(Debug, Serialize, Deserialize)] struct Person { diff --git a/examples/errors/src/main.rs b/examples/errors/src/main.rs index 6524108c..3830b3e1 100644 --- a/examples/errors/src/main.rs +++ b/examples/errors/src/main.rs @@ -5,7 +5,7 @@ #[cfg(test)] mod tests; -use rocket::{catch, response::content}; +use rocket::response::content; #[get("/hello//")] fn hello(name: String, age: i8) -> String { diff --git a/examples/handlebars_templates/src/main.rs b/examples/handlebars_templates/src/main.rs index 6c471077..5d42b4c8 100644 --- a/examples/handlebars_templates/src/main.rs +++ b/examples/handlebars_templates/src/main.rs @@ -7,7 +7,7 @@ extern crate rocket_contrib; #[cfg(test)] mod tests; -use rocket::{catch, Request}; +use rocket::Request; use rocket::response::Redirect; use rocket_contrib::{Template, handlebars}; diff --git a/examples/json/src/main.rs b/examples/json/src/main.rs index 0f75e08b..9e6fccf8 100644 --- a/examples/json/src/main.rs +++ b/examples/json/src/main.rs @@ -7,7 +7,7 @@ #[cfg(test)] mod tests; -use rocket::{catch, State}; +use rocket::State; use rocket_contrib::{Json, JsonValue}; use std::collections::HashMap; use std::sync::Mutex; diff --git a/examples/tera_templates/src/main.rs b/examples/tera_templates/src/main.rs index 16a7e411..a43c2915 100644 --- a/examples/tera_templates/src/main.rs +++ b/examples/tera_templates/src/main.rs @@ -10,7 +10,7 @@ extern crate serde_json; use std::collections::HashMap; -use rocket::{catch, Request}; +use rocket::Request; use rocket::response::Redirect; use rocket_contrib::Template; diff --git a/site/guide/requests.md b/site/guide/requests.md index 2558d9b0..2e62f31d 100644 --- a/site/guide/requests.md +++ b/site/guide/requests.md @@ -751,8 +751,6 @@ catch. For instance, to declare a catcher for `404 Not Found` errors, you'd write: ```rust -use rocket::catch; - #[catch(404)] fn not_found(req: &Request) -> T { .. } ```