Rocket

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

commit 16a65a9a45c0813c11a79544ec998359a80b140e
parent 328bf4b32e105815bffc4f3eda7ea7d31191f3f1
Author: Sergio Benitez <sb@sergio.bz>
Date:   Tue, 30 Oct 2018 02:53:19 -0700

Mention selective importing in 'rocket_codegen' docs.

Diffstat:
Mcore/codegen/src/lib.rs | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/core/codegen/src/lib.rs b/core/codegen/src/lib.rs @@ -26,7 +26,8 @@ //! rocket = "0.4.0-dev" //! ``` //! -//! And to import macros via `#[macro_use]` in the crate root: +//! And to import all macros, attributes, and derives via `#[macro_use]` in the +//! crate root: //! //! ```rust //! #![feature(proc_macro_hygiene, decl_macro)] @@ -36,6 +37,17 @@ //! # fn main() { rocket::ignite().mount("/", routes![hello]); } //! ``` //! +//! Or, alternatively, selectively import from the top-level scope: +//! +//! ```rust +//! #![feature(proc_macro_hygiene, decl_macro)] +//! # extern crate rocket; +//! +//! use rocket::{get, routes}; +//! # #[get("/")] fn hello() { } +//! # fn main() { rocket::ignite().mount("/", routes![hello]); } +//! ``` +//! //! # Debugging Codegen //! //! When the `ROCKET_CODEGEN_DEBUG` environment variable is set, this crate