Mention selective importing in 'rocket_codegen' docs.

This commit is contained in:
Sergio Benitez 2018-10-30 02:53:19 -07:00
parent 328bf4b32e
commit 16a65a9a45
1 changed files with 13 additions and 1 deletions

View File

@ -26,7 +26,8 @@
//! rocket = "0.4.0-dev" //! 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 //! ```rust
//! #![feature(proc_macro_hygiene, decl_macro)] //! #![feature(proc_macro_hygiene, decl_macro)]
@ -36,6 +37,17 @@
//! # fn main() { rocket::ignite().mount("/", routes![hello]); } //! # 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 //! # Debugging Codegen
//! //!
//! When the `ROCKET_CODEGEN_DEBUG` environment variable is set, this crate //! When the `ROCKET_CODEGEN_DEBUG` environment variable is set, this crate