Rocket

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d011cd63fcb2893ccc94296a549ed88c8d0738a4
parent d2abbe72e031eff3c37cd539b797fdb6010e5934
Author: Sergio Benitez <sb@sergio.bz>
Date:   Sun, 16 Sep 2018 20:52:07 -0700

Remove unnecessary 'use rocket::catch'.

Diffstat:
Mcore/codegen_next/tests/ui-fail/catch.rs | 4++--
Mcore/codegen_next/tests/ui-fail/catch_type_errors.rs | 4++--
Mcore/lib/src/catcher.rs | 2+-
Mcore/lib/src/rocket.rs | 2+-
Mcore/lib/tests/redirect_from_catcher-issue-113.rs | 2+-
Mexamples/content_types/src/main.rs | 5++---
Mexamples/errors/src/main.rs | 2+-
Mexamples/handlebars_templates/src/main.rs | 2+-
Mexamples/json/src/main.rs | 2+-
Mexamples/tera_templates/src/main.rs | 2+-
Msite/guide/requests.md | 2--
11 files changed, 13 insertions(+), 16 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -5,7 +5,7 @@ #[cfg(test)] mod tests; -use rocket::{catch, response::content}; +use rocket::response::content; #[get("/hello/<name>/<age>")] fn hello(name: String, age: i8) -> String { diff --git 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 @@ -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 @@ -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 @@ -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 { .. } ```