mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-17 23:19:06 +00:00
Remove unnecessary 'use rocket::catch'.
This commit is contained in:
parent
d2abbe72e0
commit
d011cd63fc
@ -1,6 +1,6 @@
|
||||
extern crate rocket;
|
||||
#[macro_use] extern crate rocket;
|
||||
|
||||
use rocket::{catch, Request};
|
||||
use rocket::Request;
|
||||
|
||||
#[catch(404)]
|
||||
struct Catcher(String);
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#[macro_use] extern crate rocket;
|
||||
|
||||
use rocket::{catch, response::Redirect};
|
||||
use rocket::response::Redirect;
|
||||
|
||||
#[catch(404)]
|
||||
fn not_found() -> Redirect {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 { .. }
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user