Skip to content

Commit

Permalink
Remove unnecessary 'use rocket::catch'.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Sep 17, 2018
1 parent d2abbe7 commit d011cd6
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions core/codegen_next/tests/ui-fail/catch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern crate rocket;
#[macro_use] extern crate rocket;

use rocket::{catch, Request};
use rocket::Request;

#[catch(404)]
struct Catcher(String);
Expand Down
4 changes: 2 additions & 2 deletions core/codegen_next/tests/ui-fail/catch_type_errors.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/catcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/rocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/lib/tests/redirect_from_catcher-issue-113.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#[macro_use] extern crate rocket;

use rocket::{catch, response::Redirect};
use rocket::response::Redirect;

#[catch(404)]
fn not_found() -> Redirect {
Expand Down
5 changes: 2 additions & 3 deletions examples/content_types/src/main.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion examples/errors/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion examples/handlebars_templates/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion examples/json/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion examples/tera_templates/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions site/guide/requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 { .. }
```
Expand Down

0 comments on commit d011cd6

Please sign in to comment.