diff --git a/README.md b/README.md index 98ec71ee..528bbc91 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ fn hello(name: &str, age: u8) -> String { #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/hello", routes![hello]) + rocket::build().mount("/hello", routes![hello]) } ``` diff --git a/contrib/lib/src/compression/fairing.rs b/contrib/lib/src/compression/fairing.rs index 00f98975..526a3b58 100644 --- a/contrib/lib/src/compression/fairing.rs +++ b/contrib/lib/src/compression/fairing.rs @@ -60,7 +60,7 @@ impl Default for Context { /// use rocket_contrib::compression::Compression; /// /// fn main() { -/// rocket::ignite() +/// rocket::build() /// // ... /// .attach(Compression::fairing()) /// // ... @@ -83,7 +83,7 @@ impl Compression { /// use rocket_contrib::compression::Compression; /// /// fn main() { - /// rocket::ignite() + /// rocket::build() /// // ... /// .attach(Compression::fairing()) /// // ... diff --git a/contrib/lib/src/databases/mod.rs b/contrib/lib/src/databases/mod.rs index 4937df07..2bb3f150 100644 --- a/contrib/lib/src/databases/mod.rs +++ b/contrib/lib/src/databases/mod.rs @@ -64,7 +64,7 @@ //! //! #[launch] //! fn rocket() -> rocket::Rocket { -//! rocket::ignite().attach(LogsDbConn::fairing()) +//! rocket::build().attach(LogsDbConn::fairing()) //! } //! # } fn main() {} //! ``` diff --git a/contrib/lib/src/helmet/helmet.rs b/contrib/lib/src/helmet/helmet.rs index 221e69e4..9a08d1a7 100644 --- a/contrib/lib/src/helmet/helmet.rs +++ b/contrib/lib/src/helmet/helmet.rs @@ -45,7 +45,7 @@ use crate::helmet::*; /// # extern crate rocket_contrib; /// # use rocket_contrib::helmet::SpaceHelmet; /// # let helmet = SpaceHelmet::default(); -/// rocket::ignite() +/// rocket::build() /// // ... /// .attach(helmet) /// # ; diff --git a/contrib/lib/src/helmet/mod.rs b/contrib/lib/src/helmet/mod.rs index a0edfceb..312c5493 100644 --- a/contrib/lib/src/helmet/mod.rs +++ b/contrib/lib/src/helmet/mod.rs @@ -65,7 +65,7 @@ //! # extern crate rocket_contrib; //! use rocket_contrib::helmet::SpaceHelmet; //! -//! let rocket = rocket::ignite().attach(SpaceHelmet::default()); +//! let rocket = rocket::build().attach(SpaceHelmet::default()); //! ``` //! //! Each header can be configured individually. To enable a particular header, diff --git a/contrib/lib/src/serve.rs b/contrib/lib/src/serve.rs index a35e3433..5544e2b1 100644 --- a/contrib/lib/src/serve.rs +++ b/contrib/lib/src/serve.rs @@ -204,7 +204,7 @@ impl std::ops::BitOr for Options { /// /// #[launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite().mount("/public", StaticFiles::from("/static")) +/// rocket::build().mount("/public", StaticFiles::from("/static")) /// } /// ``` /// @@ -228,7 +228,7 @@ impl std::ops::BitOr for Options { /// /// #[launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite().mount("/", StaticFiles::from(crate_relative!("static"))) +/// rocket::build().mount("/", StaticFiles::from(crate_relative!("static"))) /// } /// ``` #[derive(Clone)] @@ -264,7 +264,7 @@ impl StaticFiles { /// /// #[launch] /// fn rocket() -> rocket::Rocket { - /// rocket::ignite().mount("/static", StaticFiles::from("/www/public")) + /// rocket::build().mount("/static", StaticFiles::from("/www/public")) /// } /// ``` /// @@ -277,7 +277,7 @@ impl StaticFiles { /// /// #[launch] /// fn rocket() -> rocket::Rocket { - /// rocket::ignite().mount("/static", StaticFiles::from("/www/public").rank(30)) + /// rocket::build().mount("/static", StaticFiles::from("/www/public").rank(30)) /// } /// ``` pub fn from>(path: P) -> Self { @@ -307,7 +307,7 @@ impl StaticFiles { /// #[launch] /// fn rocket() -> rocket::Rocket { /// let options = Options::Index | Options::DotFiles; - /// rocket::ignite() + /// rocket::build() /// .mount("/static", StaticFiles::from("/www/public")) /// .mount("/pub", StaticFiles::new("/www/public", options).rank(-1)) /// } diff --git a/contrib/lib/src/templates/engine.rs b/contrib/lib/src/templates/engine.rs index fdcf4172..cafb39d6 100644 --- a/contrib/lib/src/templates/engine.rs +++ b/contrib/lib/src/templates/engine.rs @@ -37,7 +37,7 @@ pub(crate) trait Engine: Send + Sync + 'static { /// } /// /// fn main() { -/// rocket::ignite() +/// rocket::build() /// // ... /// .attach(Template::custom(|engines: &mut Engines| { /// engines.tera.register_filter("my_filter", my_filter); diff --git a/contrib/lib/src/templates/metadata.rs b/contrib/lib/src/templates/metadata.rs index 1fe0cbd0..15c24be6 100644 --- a/contrib/lib/src/templates/metadata.rs +++ b/contrib/lib/src/templates/metadata.rs @@ -30,7 +30,7 @@ use crate::templates::ContextManager; /// /// /// fn main() { -/// rocket::ignite() +/// rocket::build() /// .attach(Template::fairing()) /// // ... /// # ; diff --git a/contrib/lib/src/templates/mod.rs b/contrib/lib/src/templates/mod.rs index 7746a084..7b50f176 100644 --- a/contrib/lib/src/templates/mod.rs +++ b/contrib/lib/src/templates/mod.rs @@ -26,7 +26,7 @@ //! use rocket_contrib::templates::Template; //! //! fn main() { -//! rocket::ignite() +//! rocket::build() //! .attach(Template::fairing()) //! // ... //! # ; @@ -169,7 +169,7 @@ const DEFAULT_TEMPLATE_DIR: &str = "templates"; /// use rocket_contrib::templates::Template; /// /// fn main() { -/// rocket::ignite() +/// rocket::build() /// .attach(Template::fairing()) /// // ... /// # ; @@ -237,7 +237,7 @@ impl Template { /// use rocket_contrib::templates::Template; /// /// fn main() { - /// rocket::ignite() + /// rocket::build() /// // ... /// .attach(Template::fairing()) /// // ... @@ -266,7 +266,7 @@ impl Template { /// use rocket_contrib::templates::Template; /// /// fn main() { - /// rocket::ignite() + /// rocket::build() /// // ... /// .attach(Template::custom(|engines| { /// // engines.handlebars.register_helper ... @@ -297,7 +297,7 @@ impl Template { /// use rocket_contrib::templates::Template; /// /// fn main() { - /// rocket::ignite() + /// rocket::build() /// // ... /// .attach(Template::try_custom(|engines| { /// // engines.handlebars.register_helper ... @@ -361,7 +361,7 @@ impl Template { /// use rocket::local::blocking::Client; /// /// fn main() { - /// let rocket = rocket::ignite().attach(Template::fairing()); + /// let rocket = rocket::build().attach(Template::fairing()); /// let client = Client::untracked(rocket).expect("valid rocket"); /// /// // Create a `context`. Here, just an empty `HashMap`. diff --git a/contrib/lib/tests/compress_responder.rs.disabled b/contrib/lib/tests/compress_responder.rs.disabled index 978cfaa9..a17988a5 100644 --- a/contrib/lib/tests/compress_responder.rs.disabled +++ b/contrib/lib/tests/compress_responder.rs.disabled @@ -61,7 +61,7 @@ mod compress_responder_tests { } fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![index, font, image, already_encoded, identity]) + rocket::build().mount("/", routes![index, font, image, already_encoded, identity]) } #[test] diff --git a/contrib/lib/tests/compression_fairing.rs.disabled b/contrib/lib/tests/compression_fairing.rs.disabled index 6a99265d..a89f996b 100644 --- a/contrib/lib/tests/compression_fairing.rs.disabled +++ b/contrib/lib/tests/compression_fairing.rs.disabled @@ -63,7 +63,7 @@ mod compression_fairing_tests { } fn rocket() -> rocket::Rocket { - rocket::ignite() + rocket::build() .mount( "/", routes![index, font, image, tar, already_encoded, identity], diff --git a/contrib/lib/tests/helmet.rs b/contrib/lib/tests/helmet.rs index 5e603c1b..10713488 100644 --- a/contrib/lib/tests/helmet.rs +++ b/contrib/lib/tests/helmet.rs @@ -31,7 +31,7 @@ mod helmet_tests { macro_rules! dispatch { ($helmet:expr, $closure:expr) => {{ - let rocket = rocket::ignite().mount("/", routes![hello]).attach($helmet); + let rocket = rocket::build().mount("/", routes![hello]).attach($helmet); let client = Client::debug(rocket).unwrap(); let response = client.get("/").dispatch(); assert_eq!(response.status(), Status::Ok); diff --git a/contrib/lib/tests/static_files.rs b/contrib/lib/tests/static_files.rs index a9c4af52..9f591dd1 100644 --- a/contrib/lib/tests/static_files.rs +++ b/contrib/lib/tests/static_files.rs @@ -14,7 +14,7 @@ mod static_tests { fn rocket() -> Rocket { let root = static_root(); - rocket::ignite() + rocket::build() .mount("/default", StaticFiles::from(&root)) .mount("/no_index", StaticFiles::new(&root, Options::None)) .mount("/dots", StaticFiles::new(&root, Options::DotFiles)) diff --git a/contrib/lib/tests/templates.rs b/contrib/lib/tests/templates.rs index b753ba80..61fe699f 100644 --- a/contrib/lib/tests/templates.rs +++ b/contrib/lib/tests/templates.rs @@ -36,7 +36,7 @@ mod templates_tests { fn test_callback_error() { use rocket::{local::blocking::Client, error::ErrorKind::FailedFairings}; - let rocket = rocket::ignite().attach(Template::try_custom(|_| { + let rocket = rocket::build().attach(Template::try_custom(|_| { Err("error reloading templates!".into()) })); diff --git a/core/codegen/src/lib.rs b/core/codegen/src/lib.rs index b438d6ad..518593e3 100644 --- a/core/codegen/src/lib.rs +++ b/core/codegen/src/lib.rs @@ -30,7 +30,7 @@ //! ```rust //! #[macro_use] extern crate rocket; //! # #[get("/")] fn hello() { } -//! # fn main() { rocket::ignite().mount("/", routes![hello]); } +//! # fn main() { rocket::build().mount("/", routes![hello]); } //! ``` //! //! Or, alternatively, selectively import from the top-level scope: @@ -40,7 +40,7 @@ //! //! use rocket::{get, routes}; //! # #[get("/")] fn hello() { } -//! # fn main() { rocket::ignite().mount("/", routes![hello]); } +//! # fn main() { rocket::build().mount("/", routes![hello]); } //! ``` //! //! # Debugging Codegen diff --git a/core/codegen/tests/async-entry.rs b/core/codegen/tests/async-entry.rs index d64b5240..6ff8dedb 100644 --- a/core/codegen/tests/async-entry.rs +++ b/core/codegen/tests/async-entry.rs @@ -4,8 +4,8 @@ mod a { // async launch that is async. #[rocket::launch] async fn rocket() -> rocket::Rocket { - let _ = rocket::ignite().launch().await; - rocket::ignite() + let _ = rocket::build().launch().await; + rocket::build() } async fn use_it() { @@ -17,7 +17,7 @@ mod b { // async launch that isn't async. #[rocket::launch] async fn main2() -> rocket::Rocket { - rocket::ignite() + rocket::build() } async fn use_it() { @@ -27,7 +27,7 @@ mod b { mod b_inferred { #[rocket::launch] - async fn main2() -> _ { rocket::ignite() } + async fn main2() -> _ { rocket::build() } async fn use_it() { let rocket: rocket::Rocket = main2().await; @@ -38,7 +38,7 @@ mod c { // non-async launch. #[rocket::launch] fn rocket() -> rocket::Rocket { - rocket::ignite() + rocket::build() } fn use_it() { @@ -48,7 +48,7 @@ mod c { mod c_inferred { #[rocket::launch] - fn rocket() -> _ { rocket::ignite() } + fn rocket() -> _ { rocket::build() } fn use_it() { let rocket: rocket::Rocket = rocket(); @@ -59,7 +59,7 @@ mod d { // main with async, is async. #[rocket::main] async fn main() { - let _ = rocket::ignite().launch().await; + let _ = rocket::build().launch().await; } } @@ -73,7 +73,7 @@ mod f { // main with async, is async, with termination return. #[rocket::main] async fn main() -> Result<(), String> { - let result = rocket::ignite().launch().await; + let result = rocket::build().launch().await; result.map_err(|e| e.to_string()) } } @@ -89,6 +89,6 @@ mod g { // main with async, is async, with termination return. #[rocket::main] async fn main() -> Result<(), String> { - let result = rocket::ignite().launch().await; + let result = rocket::build().launch().await; result.map_err(|e| e.to_string()) } diff --git a/core/codegen/tests/expansion.rs b/core/codegen/tests/expansion.rs index 5ef77aca..bb130472 100644 --- a/core/codegen/tests/expansion.rs +++ b/core/codegen/tests/expansion.rs @@ -33,7 +33,7 @@ foo!("/hello/", name); #[test] fn test_reexpansion() { - let rocket = rocket::ignite().mount("/", routes![easy, hard, hi]); + let rocket = rocket::build().mount("/", routes![easy, hard, hi]); let client = Client::debug(rocket).unwrap(); let response = client.get("/easy/327").dispatch(); @@ -59,7 +59,7 @@ index!(i32); #[test] fn test_index() { - let rocket = rocket::ignite().mount("/", routes![index]).manage(100i32); + let rocket = rocket::build().mount("/", routes![index]).manage(100i32); let client = Client::debug(rocket).unwrap(); let response = client.get("/").dispatch(); diff --git a/core/codegen/tests/route-data.rs b/core/codegen/tests/route-data.rs index c086267b..9296b6e4 100644 --- a/core/codegen/tests/route-data.rs +++ b/core/codegen/tests/route-data.rs @@ -32,7 +32,7 @@ fn simple<'r>(simple: Simple<'r>) -> &'r str { simple.0 } #[test] fn test_data() { - let rocket = rocket::ignite().mount("/", routes![form, simple]); + let rocket = rocket::build().mount("/", routes![form, simple]); let client = Client::debug(rocket).unwrap(); let response = client.post("/f") diff --git a/core/codegen/tests/route-format.rs b/core/codegen/tests/route-format.rs index 714614c9..5140a27d 100644 --- a/core/codegen/tests/route-format.rs +++ b/core/codegen/tests/route-format.rs @@ -33,7 +33,7 @@ fn other() -> &'static str { "other" } #[test] fn test_formats() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/", routes![json, xml, json_long, msgpack_long, msgpack, plain, binary, other]); @@ -84,7 +84,7 @@ fn put_bar_baz() -> &'static str { "put_bar_baz" } #[test] fn test_custom_formats() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/", routes![get_foo, post_foo, get_bar_baz, put_bar_baz]); let client = Client::debug(rocket).unwrap(); diff --git a/core/codegen/tests/route-ranking.rs b/core/codegen/tests/route-ranking.rs index 585fb243..103e5052 100644 --- a/core/codegen/tests/route-ranking.rs +++ b/core/codegen/tests/route-ranking.rs @@ -18,7 +18,7 @@ fn get3(_number: u64) -> &'static str { "3" } #[test] fn test_ranking() { - let rocket = rocket::ignite().mount("/", routes![get0, get1, get2, get3]); + let rocket = rocket::build().mount("/", routes![get0, get1, get2, get3]); let client = Client::debug(rocket).unwrap(); let response = client.get("/0").dispatch(); @@ -43,7 +43,7 @@ fn get0b(_n: u8) { } fn test_rank_collision() { use rocket::error::ErrorKind; - let rocket = rocket::ignite().mount("/", routes![get0, get0b]); + let rocket = rocket::build().mount("/", routes![get0, get0b]); let client_result = Client::debug(rocket); match client_result.as_ref().map_err(|e| e.kind()) { Err(ErrorKind::Collisions(..)) => { /* o.k. */ }, diff --git a/core/codegen/tests/route-raw.rs b/core/codegen/tests/route-raw.rs index 043afa3c..e89c594f 100644 --- a/core/codegen/tests/route-raw.rs +++ b/core/codegen/tests/route-raw.rs @@ -21,7 +21,7 @@ fn catch(r#raw: &rocket::Request) -> String { #[test] fn test_raw_ident() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/", routes![get, swap]) .register("/", catchers![catch]); diff --git a/core/codegen/tests/route.rs b/core/codegen/tests/route.rs index 3386236c..28b7b083 100644 --- a/core/codegen/tests/route.rs +++ b/core/codegen/tests/route.rs @@ -83,7 +83,7 @@ fn test_unused_params(_unused_param: String, _unused_query: String, _unused_data #[test] fn test_full_route() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/1", routes![post1]) .mount("/2", routes![post2]); @@ -145,7 +145,7 @@ mod scopes { use other::world; fn _rocket() -> rocket::Rocket { - rocket::ignite().mount("/", rocket::routes![hello, world]) + rocket::build().mount("/", rocket::routes![hello, world]) } } @@ -170,7 +170,7 @@ fn filtered_raw_query(bird: usize, color: &str, rest: Contextual<'_, Filtered<'_ #[test] fn test_filtered_raw_query() { - let rocket = rocket::ignite().mount("/", routes![filtered_raw_query]); + let rocket = rocket::build().mount("/", routes![filtered_raw_query]); let client = Client::debug(rocket).unwrap(); #[track_caller] @@ -290,10 +290,10 @@ fn test_query_collection() { assert_eq!(run(&client, colors, dog).1, "blue&green&blue - Max Fido - 10"); } - let rocket = rocket::ignite().mount("/", routes![query_collection]); + let rocket = rocket::build().mount("/", routes![query_collection]); run_tests(rocket); - let rocket = rocket::ignite().mount("/", routes![query_collection_2]); + let rocket = rocket::build().mount("/", routes![query_collection_2]); run_tests(rocket); } @@ -323,7 +323,7 @@ fn segments_empty(path: PathString) -> String { #[test] fn test_inclusive_segments() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/", routes![segments]) .mount("/", routes![segments_empty]); diff --git a/core/codegen/tests/segment-ignore.rs b/core/codegen/tests/segment-ignore.rs index c9996014..5bd015fa 100644 --- a/core/codegen/tests/segment-ignore.rs +++ b/core/codegen/tests/segment-ignore.rs @@ -23,7 +23,7 @@ fn test_ignored_segments() { client.get(url).dispatch().into_string().unwrap() } - let rocket = rocket::ignite().mount("/", routes![ + let rocket = rocket::build().mount("/", routes![ ig_1, just_static, ig_2, ig_3, ig_1_static, ig_1_static_static, wrapped ]); diff --git a/core/codegen/tests/ui-fail-nightly/async-entry.stderr b/core/codegen/tests/ui-fail-nightly/async-entry.stderr index 8a2dfb27..73384ca0 100644 --- a/core/codegen/tests/ui-fail-nightly/async-entry.stderr +++ b/core/codegen/tests/ui-fail-nightly/async-entry.stderr @@ -110,14 +110,14 @@ error[E0728]: `await` is only allowed inside `async` functions and blocks | 74 | fn rocket() -> rocket::Rocket { | ------ this is not `async` -75 | let _ = rocket::ignite().launch().await; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks +75 | let _ = rocket::build().launch().await; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks error[E0308]: mismatched types --> $DIR/async-entry.rs:37:9 | -37 | rocket::ignite() - | ^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `Rocket` +37 | rocket::build() + | ^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `Rocket` error[E0308]: mismatched types --> $DIR/async-entry.rs:46:9 @@ -132,7 +132,7 @@ error[E0308]: mismatched types | ^ expected `()` because of default return type | _____________________| | | -27 | | rocket::ignite() +27 | | rocket::build() 28 | | } | | ^- help: consider using a semicolon here: `;` | |_____| diff --git a/core/codegen/tests/ui-fail-stable/async-entry.stderr b/core/codegen/tests/ui-fail-stable/async-entry.stderr index efbce3a4..171eba60 100644 --- a/core/codegen/tests/ui-fail-stable/async-entry.stderr +++ b/core/codegen/tests/ui-fail-stable/async-entry.stderr @@ -104,14 +104,14 @@ error[E0728]: `await` is only allowed inside `async` functions and blocks | 74 | fn rocket() -> rocket::Rocket { | ------ this is not `async` -75 | let _ = rocket::ignite().launch().await; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks +75 | let _ = rocket::build().launch().await; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks error[E0308]: mismatched types --> $DIR/async-entry.rs:37:9 | -37 | rocket::ignite() - | ^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `Rocket` +37 | rocket::build() + | ^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `Rocket` error[E0308]: mismatched types --> $DIR/async-entry.rs:46:9 @@ -126,7 +126,7 @@ error[E0308]: mismatched types | ^ expected `()` because of default return type | _____________________| | | -27 | | rocket::ignite() +27 | | rocket::build() 28 | | } | | ^- help: try adding a semicolon: `;` | |_____| diff --git a/core/codegen/tests/ui-fail/async-entry.rs b/core/codegen/tests/ui-fail/async-entry.rs index d2a5acdb..45ad3ee9 100644 --- a/core/codegen/tests/ui-fail/async-entry.rs +++ b/core/codegen/tests/ui-fail/async-entry.rs @@ -17,14 +17,14 @@ mod main_b { mod main_d { #[rocket::main] fn main() { - let _ = rocket::ignite().launch().await; + let _ = rocket::build().launch().await; } } mod main_f { #[rocket::main] async fn main() { - rocket::ignite() + rocket::build() } } @@ -33,8 +33,8 @@ mod main_f { mod launch_a { #[rocket::launch] async fn rocket() -> String { - let _ = rocket::ignite().launch().await; - rocket::ignite() + let _ = rocket::build().launch().await; + rocket::build() } } @@ -42,7 +42,7 @@ mod launch_a { mod launch_b { #[rocket::launch] async fn rocket() -> rocket::Rocket { - let _ = rocket::ignite().launch().await; + let _ = rocket::build().launch().await; "hi".to_string() } } @@ -50,37 +50,37 @@ mod launch_b { mod launch_c { #[rocket::launch] fn main() -> rocket::Rocket { - rocket::ignite() + rocket::build() } } mod launch_d { #[rocket::launch] async fn rocket() { - let _ = rocket::ignite().launch().await; - rocket::ignite() + let _ = rocket::build().launch().await; + rocket::build() } } mod launch_e { #[rocket::launch] fn rocket() { - rocket::ignite() + rocket::build() } } mod launch_f { #[rocket::launch] fn rocket() -> rocket::Rocket { - let _ = rocket::ignite().launch().await; - rocket::ignite() + let _ = rocket::build().launch().await; + rocket::build() } } mod launch_g { #[rocket::launch] fn main() -> &'static str { - let _ = rocket::ignite().launch().await; + let _ = rocket::build().launch().await; "hi" } } @@ -88,11 +88,11 @@ mod launch_g { mod launch_h { #[rocket::launch] async fn main() -> rocket::Rocket { - rocket::ignite() + rocket::build() } } #[rocket::main] async fn main() -> rocket::Rocket { - rocket::ignite() + rocket::build() } diff --git a/core/lib/src/catcher.rs b/core/lib/src/catcher.rs index 0d29d619..33881a0d 100644 --- a/core/lib/src/catcher.rs +++ b/core/lib/src/catcher.rs @@ -88,7 +88,7 @@ pub(crate) fn dummy<'r>(_: Status, _: &'r Request<'_>) -> ErrorHandlerFuture<'r> /// /// #[launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite().register("/", catchers![internal_error, not_found, default]) +/// rocket::build().register("/", catchers![internal_error, not_found, default]) /// } /// ``` /// @@ -293,7 +293,7 @@ impl Default for Catcher { /// /// #[rocket::launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite() +/// rocket::build() /// // to handle only `404` /// .register("/", CustomHandler::catch(Status::NotFound, Kind::Simple)) /// // or to register as the default diff --git a/core/lib/src/config/config.rs b/core/lib/src/config/config.rs index 33739b6b..5102cce8 100644 --- a/core/lib/src/config/config.rs +++ b/core/lib/src/config/config.rs @@ -192,7 +192,7 @@ impl Config { } } - /// Returns the default provider figment used by [`rocket::ignite()`]. + /// Returns the default provider figment used by [`rocket::build()`]. /// /// The default figment reads from the following sources, in ascending /// priority order: @@ -205,7 +205,7 @@ impl Config { /// environment variable. If it is not set, it defaults to `debug` when /// compiled in debug mode and `release` when compiled in release mode. /// - /// [`rocket::ignite()`]: crate::ignite() + /// [`rocket::build()`]: crate::build() /// /// # Example /// diff --git a/core/lib/src/config/mod.rs b/core/lib/src/config/mod.rs index 105a7149..20e2d109 100644 --- a/core/lib/src/config/mod.rs +++ b/core/lib/src/config/mod.rs @@ -21,7 +21,7 @@ //! //! #[rocket::launch] //! fn rocket() -> _ { -//! rocket::ignite().attach(AdHoc::config::()) +//! rocket::build().attach(AdHoc::config::()) //! } //! ``` //! @@ -44,7 +44,7 @@ //! ## Custom Providers //! //! A custom provider can be set via [`rocket::custom()`], which replaces calls to -//! [`rocket::ignite()`]. The configured provider can be built on top of +//! [`rocket::build()`]. The configured provider can be built on top of //! [`Config::figment()`], [`Config::default()`], both, or neither. The //! [Figment](figment) documentation has full details on instantiating existing //! providers like [`Toml`]() and [`Env`] as well as creating custom providers for @@ -107,7 +107,7 @@ //! ``` //! //! [`rocket::custom()`]: crate::custom() -//! [`rocket::ignite()`]: crate::ignite() +//! [`rocket::build()`]: crate::build() //! [`Toml`]: figment::providers::Toml //! [`Env`]: figment::providers::Env diff --git a/core/lib/src/error.rs b/core/lib/src/error.rs index 09a5be22..0461eed6 100644 --- a/core/lib/src/error.rs +++ b/core/lib/src/error.rs @@ -23,7 +23,7 @@ use figment::Profile; /// /// ```rust /// # let _ = async { -/// if let Err(error) = rocket::ignite().launch().await { +/// if let Err(error) = rocket::build().launch().await { /// // This println "inspects" the error. /// println!("Launch failed! Error: {}", error); /// @@ -38,7 +38,7 @@ use figment::Profile; /// /// ```rust /// # let _ = async { -/// let error = rocket::ignite().launch().await; +/// let error = rocket::build().launch().await; /// /// // This call to drop (explicit here for demonstration) will result in /// // `error` being pretty-printed to the console along with a `panic!`. @@ -115,7 +115,7 @@ impl Error { /// use rocket::error::ErrorKind; /// /// # let _ = async { - /// if let Err(error) = rocket::ignite().launch().await { + /// if let Err(error) = rocket::build().launch().await { /// match error.kind() { /// ErrorKind::Io(e) => println!("found an i/o launch error: {}", e), /// e => println!("something else happened: {}", e) diff --git a/core/lib/src/fairing/ad_hoc.rs b/core/lib/src/fairing/ad_hoc.rs index 126a6019..b9da0680 100644 --- a/core/lib/src/fairing/ad_hoc.rs +++ b/core/lib/src/fairing/ad_hoc.rs @@ -27,7 +27,7 @@ use crate::fairing::{Fairing, Kind, Info}; /// use rocket::fairing::AdHoc; /// use rocket::http::Method; /// -/// rocket::ignite() +/// rocket::build() /// .attach(AdHoc::on_liftoff("Liftoff Printer", |_| Box::pin(async move { /// println!("...annnddd we have liftoff!"); /// }))) diff --git a/core/lib/src/fairing/mod.rs b/core/lib/src/fairing/mod.rs index 4c0304de..d2434a58 100644 --- a/core/lib/src/fairing/mod.rs +++ b/core/lib/src/fairing/mod.rs @@ -23,7 +23,7 @@ //! # use rocket::fairing::AdHoc; //! # let req_fairing = AdHoc::on_request("Request", |_, _| Box::pin(async move {})); //! # let res_fairing = AdHoc::on_response("Response", |_, _| Box::pin(async move {})); -//! let rocket = rocket::ignite() +//! let rocket = rocket::build() //! .attach(req_fairing) //! .attach(res_fairing); //! ``` diff --git a/core/lib/src/handler.rs b/core/lib/src/handler.rs index f32901db..0d20f52b 100644 --- a/core/lib/src/handler.rs +++ b/core/lib/src/handler.rs @@ -73,7 +73,7 @@ pub type HandlerFuture<'r> = BoxFuture<'r, Outcome<'r>>; /// /// #[rocket::launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite().mount("/", CustomHandler(Kind::Simple)) +/// rocket::build().mount("/", CustomHandler(Kind::Simple)) /// } /// ``` /// @@ -116,7 +116,7 @@ pub type HandlerFuture<'r> = BoxFuture<'r, Outcome<'r>>; /// /// #[launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite() +/// rocket::build() /// .mount("/", routes![custom_handler]) /// .manage(Kind::Simple) /// } diff --git a/core/lib/src/lib.rs b/core/lib/src/lib.rs index fe869ac7..4d3d26e7 100644 --- a/core/lib/src/lib.rs +++ b/core/lib/src/lib.rs @@ -61,7 +61,7 @@ //! //! #[launch] //! fn rocket() -> _ { -//! rocket::ignite().mount("/", routes![hello]) +//! rocket::build().mount("/", routes![hello]) //! } //! ``` //! @@ -165,9 +165,9 @@ pub use crate::rocket::Rocket; pub use crate::shutdown::Shutdown; pub use crate::state::State; -/// Creates a new instance of `Rocket`: aliases [`Rocket::ignite()`]. -pub fn ignite() -> Rocket { - Rocket::ignite() +/// Creates a new instance of `Rocket`: aliases [`Rocket::build()`]. +pub fn build() -> Rocket { + Rocket::build() } /// Creates a new instance of `Rocket` with a custom configuration provider: diff --git a/core/lib/src/local/asynchronous/client.rs b/core/lib/src/local/asynchronous/client.rs index 4bf7dad2..35356f03 100644 --- a/core/lib/src/local/asynchronous/client.rs +++ b/core/lib/src/local/asynchronous/client.rs @@ -40,7 +40,7 @@ use crate::error::Error; /// use rocket::local::asynchronous::Client; /// /// # rocket::async_test(async { -/// let rocket = rocket::ignite(); +/// let rocket = rocket::build(); /// let client = Client::tracked(rocket).await.expect("valid rocket"); /// let response = client.post("/") /// .body("Hello, world!") @@ -70,7 +70,7 @@ impl Client { where F: FnOnce(&Self, LocalRequest<'_>, LocalResponse<'_>) -> T + Send { crate::async_test(async { - let client = Client::debug(crate::ignite()).await.unwrap(); + let client = Client::debug(crate::build()).await.unwrap(); let request = client.get("/"); let response = request.clone().dispatch().await; f(&client, request, response) diff --git a/core/lib/src/local/asynchronous/request.rs b/core/lib/src/local/asynchronous/request.rs index a6333e43..dc5c8882 100644 --- a/core/lib/src/local/asynchronous/request.rs +++ b/core/lib/src/local/asynchronous/request.rs @@ -21,7 +21,7 @@ use super::{Client, LocalResponse}; /// use rocket::http::{ContentType, Cookie}; /// /// # rocket::async_test(async { -/// let client = Client::tracked(rocket::ignite()).await.expect("valid rocket"); +/// let client = Client::tracked(rocket::build()).await.expect("valid rocket"); /// let req = client.post("/") /// .header(ContentType::JSON) /// .remote("127.0.0.1:8000".parse().unwrap()) diff --git a/core/lib/src/local/asynchronous/response.rs b/core/lib/src/local/asynchronous/response.rs index 43394242..467aa5c5 100644 --- a/core/lib/src/local/asynchronous/response.rs +++ b/core/lib/src/local/asynchronous/response.rs @@ -29,7 +29,7 @@ use crate::{Request, Response}; /// /// #[launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite().mount("/", routes![hello_world]) +/// rocket::build().mount("/", routes![hello_world]) /// # .reconfigure(rocket::Config::debug_default()) /// } /// diff --git a/core/lib/src/local/blocking/client.rs b/core/lib/src/local/blocking/client.rs index ba3e8bc0..16e49c89 100644 --- a/core/lib/src/local/blocking/client.rs +++ b/core/lib/src/local/blocking/client.rs @@ -20,7 +20,7 @@ use crate::http::{Method, uri::Origin}; /// ```rust,no_run /// use rocket::local::blocking::Client; /// -/// let rocket = rocket::ignite(); +/// let rocket = rocket::build(); /// let client = Client::tracked(rocket).expect("valid rocket"); /// let response = client.post("/") /// .body("Hello, world!") @@ -50,7 +50,7 @@ impl Client { pub fn _test(f: F) -> T where F: FnOnce(&Self, LocalRequest<'_>, LocalResponse<'_>) -> T + Send { - let client = Client::debug(crate::ignite()).unwrap(); + let client = Client::debug(crate::build()).unwrap(); let request = client.get("/"); let response = request.clone().dispatch(); f(&client, request, response) diff --git a/core/lib/src/local/blocking/request.rs b/core/lib/src/local/blocking/request.rs index 32489118..18abef16 100644 --- a/core/lib/src/local/blocking/request.rs +++ b/core/lib/src/local/blocking/request.rs @@ -19,7 +19,7 @@ use super::{Client, LocalResponse}; /// use rocket::local::blocking::{Client, LocalRequest}; /// use rocket::http::{ContentType, Cookie}; /// -/// let client = Client::tracked(rocket::ignite()).expect("valid rocket"); +/// let client = Client::tracked(rocket::build()).expect("valid rocket"); /// let req = client.post("/") /// .header(ContentType::JSON) /// .remote("127.0.0.1:8000".parse().unwrap()) diff --git a/core/lib/src/local/blocking/response.rs b/core/lib/src/local/blocking/response.rs index da4ad766..5b706ffd 100644 --- a/core/lib/src/local/blocking/response.rs +++ b/core/lib/src/local/blocking/response.rs @@ -26,7 +26,7 @@ use super::Client; /// /// #[launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite().mount("/", routes![hello_world]) +/// rocket::build().mount("/", routes![hello_world]) /// # .reconfigure(rocket::Config::debug_default()) /// } /// diff --git a/core/lib/src/local/client.rs b/core/lib/src/local/client.rs index 449cf1ed..884c2f6f 100644 --- a/core/lib/src/local/client.rs +++ b/core/lib/src/local/client.rs @@ -63,7 +63,7 @@ macro_rules! pub_client_impl { /// ```rust,no_run #[doc = $import] /// - /// let rocket = rocket::ignite(); + /// let rocket = rocket::build(); /// let client = Client::tracked(rocket); /// ``` #[inline(always)] @@ -88,7 +88,7 @@ macro_rules! pub_client_impl { /// ```rust,no_run #[doc = $import] /// - /// let rocket = rocket::ignite(); + /// let rocket = rocket::build(); /// let client = Client::untracked(rocket); /// ``` pub $($prefix)? fn untracked(rocket: Rocket) -> Result { diff --git a/core/lib/src/local/mod.rs b/core/lib/src/local/mod.rs index 4c2a101f..f969d4db 100644 --- a/core/lib/src/local/mod.rs +++ b/core/lib/src/local/mod.rs @@ -45,7 +45,7 @@ //! #[launch] //! # */ //! fn rocket() -> rocket::Rocket { -//! rocket::ignite().mount("/", routes![hello]) +//! rocket::build().mount("/", routes![hello]) //! } //! //! #[cfg(test)] diff --git a/core/lib/src/rocket.rs b/core/lib/src/rocket.rs index d948219a..1419d71e 100644 --- a/core/lib/src/rocket.rs +++ b/core/lib/src/rocket.rs @@ -37,7 +37,7 @@ impl Rocket { /// for more information on defaults. /// /// This method is typically called through the - /// [`rocket::ignite()`](crate::ignite) alias. + /// [`rocket::build()`](crate::build) alias. /// /// # Panics /// @@ -48,12 +48,12 @@ impl Rocket { /// /// ```rust /// # { - /// rocket::ignite() + /// rocket::build() /// # }; /// ``` #[track_caller] #[inline(always)] - pub fn ignite() -> Rocket { + pub fn build() -> Rocket { Rocket::custom(Config::figment()) } @@ -178,7 +178,7 @@ impl Rocket { /// /// #[launch] /// fn rocket() -> rocket::Rocket { - /// rocket::ignite().mount("/hello", routes![hi]) + /// rocket::build().mount("/hello", routes![hi]) /// } /// ``` /// @@ -196,7 +196,7 @@ impl Rocket { /// } /// /// # let _ = async { // We don't actually want to launch the server in an example. - /// rocket::ignite().mount("/hello", vec![Route::new(Get, "/world", hi)]) + /// rocket::build().mount("/hello", vec![Route::new(Get, "/world", hi)]) /// # .launch().await; /// # }; /// ``` @@ -264,7 +264,7 @@ impl Rocket { /// /// #[launch] /// fn rocket() -> rocket::Rocket { - /// rocket::ignite().register("/", catchers![internal_error, not_found]) + /// rocket::build().register("/", catchers![internal_error, not_found]) /// } /// ``` pub fn register<'a, B, C>(mut self, base: B, catchers: C) -> Self @@ -323,7 +323,7 @@ impl Rocket { /// /// #[launch] /// fn rocket() -> rocket::Rocket { - /// rocket::ignite() + /// rocket::build() /// .mount("/", routes![index]) /// .manage(MyValue(10)) /// } @@ -351,7 +351,7 @@ impl Rocket { /// /// #[launch] /// fn rocket() -> rocket::Rocket { - /// rocket::ignite() + /// rocket::build() /// .attach(AdHoc::on_liftoff("Liftoff Message", |_| Box::pin(async { /// println!("We have liftoff!"); /// }))) @@ -373,7 +373,7 @@ impl Rocket { /// /// #[launch] /// fn rocket() -> rocket::Rocket { - /// rocket::ignite() + /// rocket::build() /// .attach(AdHoc::on_liftoff("Print Config", |rocket| Box::pin(async move { /// println!("Rocket launch config: {:?}", rocket.config()); /// }))) @@ -389,7 +389,7 @@ impl Rocket { /// # Example /// /// ```rust - /// let rocket = rocket::ignite(); + /// let rocket = rocket::build(); /// let figment = rocket.figment(); /// /// let port: u16 = figment.extract_inner("port").unwrap(); @@ -416,7 +416,7 @@ impl Rocket { /// } /// /// fn main() { - /// let mut rocket = rocket::ignite() + /// let mut rocket = rocket::build() /// .mount("/", routes![hello]) /// .mount("/hi", routes![hello]); /// @@ -451,7 +451,7 @@ impl Rocket { /// #[catch(default)] fn some_default() -> &'static str { "Everything else." } /// /// fn main() { - /// let mut rocket = rocket::ignite() + /// let mut rocket = rocket::build() /// .register("/", catchers![not_found, just_500, some_default]); /// /// let mut codes: Vec<_> = rocket.catchers().map(|c| c.code).collect(); @@ -474,7 +474,7 @@ impl Rocket { /// #[derive(PartialEq, Debug)] /// struct MyState(&'static str); /// - /// let rocket = rocket::ignite().manage(MyState("hello!")); + /// let rocket = rocket::build().manage(MyState("hello!")); /// assert_eq!(rocket.state::(), Some(&MyState("hello!"))); /// ``` #[inline(always)] @@ -490,7 +490,7 @@ impl Rocket { /// ```rust,no_run /// # use std::{thread, time::Duration}; /// # rocket::async_test(async { - /// let mut rocket = rocket::ignite(); + /// let mut rocket = rocket::build(); /// let handle = rocket.shutdown(); /// /// thread::spawn(move || { @@ -571,7 +571,7 @@ impl Rocket { /// #[rocket::main] /// async fn main() { /// # if false { - /// let result = rocket::ignite().launch().await; + /// let result = rocket::build().launch().await; /// assert!(result.is_ok()); /// # } /// } diff --git a/core/lib/src/router/uri.rs b/core/lib/src/router/uri.rs index 73ec5c04..ab0141a6 100644 --- a/core/lib/src/router/uri.rs +++ b/core/lib/src/router/uri.rs @@ -26,7 +26,7 @@ use crate::router::segment::Segment; /// let route = Route::new(Method::Get, "/foo/", handler); /// assert_eq!(route.uri.base(), "/"); /// -/// let rocket = rocket::ignite().mount("/base", vec![route]); +/// let rocket = rocket::build().mount("/base", vec![route]); /// let routes: Vec<_> = rocket.routes().collect(); /// assert_eq!(routes[0].uri.base(), "/base"); /// ``` @@ -46,7 +46,7 @@ use crate::router::segment::Segment; /// let route = Route::new(Method::Get, "/foo/", handler); /// assert_eq!(route.uri, "/foo/"); /// -/// let rocket = rocket::ignite().mount("/base", vec![route]); +/// let rocket = rocket::build().mount("/base", vec![route]); /// let routes: Vec<_> = rocket.routes().collect(); /// assert_eq!(routes[0].uri, "/base/foo/"); /// ``` diff --git a/core/lib/src/shutdown.rs b/core/lib/src/shutdown.rs index 2ec066af..731d131f 100644 --- a/core/lib/src/shutdown.rs +++ b/core/lib/src/shutdown.rs @@ -24,7 +24,7 @@ use tokio::sync::mpsc; /// /// #[rocket::main] /// async fn main() { -/// let result = rocket::ignite() +/// let result = rocket::build() /// .mount("/", routes![shutdown]) /// .launch() /// .await; diff --git a/core/lib/src/state.rs b/core/lib/src/state.rs index d4030d5c..c038c4da 100644 --- a/core/lib/src/state.rs +++ b/core/lib/src/state.rs @@ -44,7 +44,7 @@ use crate::http::Status; /// /// #[launch] /// fn rocket() -> rocket::Rocket { -/// rocket::ignite() +/// rocket::build() /// .mount("/", routes![index, raw_config_value]) /// .manage(MyConfig { user_val: "user input".to_string() }) /// } @@ -101,7 +101,7 @@ use crate::http::Status; /// state.0.to_string() /// } /// -/// let mut rocket = rocket::ignite().manage(MyManagedState(127)); +/// let mut rocket = rocket::build().manage(MyManagedState(127)); /// let state = State::from(&rocket).expect("managed `MyManagedState`"); /// assert_eq!(handler(state), "127"); /// ``` @@ -154,7 +154,7 @@ impl<'r, T: Send + Sync + 'static> State<'r, T> { /// #[derive(Debug, PartialEq)] /// struct Unmanaged(usize); /// - /// let rocket = rocket::ignite().manage(Managed(7)); + /// let rocket = rocket::build().manage(Managed(7)); /// /// let state: Option> = State::from(&rocket); /// assert_eq!(state.map(|s| s.inner()), Some(&Managed(7))); diff --git a/core/lib/tests/catcher-cookies-1213.rs b/core/lib/tests/catcher-cookies-1213.rs index 58919089..d8d09f17 100644 --- a/core/lib/tests/catcher-cookies-1213.rs +++ b/core/lib/tests/catcher-cookies-1213.rs @@ -22,7 +22,7 @@ mod tests { #[test] fn error_catcher_sets_cookies() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/", routes![index]) .register("/", catchers![not_found]) .attach(AdHoc::on_request("Add Cookie", |req, _| Box::pin(async move { diff --git a/core/lib/tests/fairing_before_head_strip-issue-546.rs b/core/lib/tests/fairing_before_head_strip-issue-546.rs index 5f2cce0d..47cd5599 100644 --- a/core/lib/tests/fairing_before_head_strip-issue-546.rs +++ b/core/lib/tests/fairing_before_head_strip-issue-546.rs @@ -26,7 +26,7 @@ mod fairing_before_head_strip { #[test] fn not_auto_handled() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/", routes![head]) .attach(AdHoc::on_request("Check HEAD", |req, _| { Box::pin(async move { @@ -52,7 +52,7 @@ mod fairing_before_head_strip { struct Counter(AtomicUsize); let counter = Counter::default(); - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/", routes![auto]) .manage(counter) .attach(AdHoc::on_request("Check HEAD + Count", |req, _| { diff --git a/core/lib/tests/local-client-access-runtime-in-drop.rs b/core/lib/tests/local-client-access-runtime-in-drop.rs index 6b67ab42..9083b817 100644 --- a/core/lib/tests/local-client-access-runtime-in-drop.rs +++ b/core/lib/tests/local-client-access-runtime-in-drop.rs @@ -10,5 +10,5 @@ impl Drop for SpawnBlockingOnDrop { #[test] fn test_access_runtime_in_state_drop() { - Client::debug(rocket::ignite().manage(SpawnBlockingOnDrop)).unwrap(); + Client::debug(rocket::build().manage(SpawnBlockingOnDrop)).unwrap(); } diff --git a/core/lib/tests/local-request-content-type-issue-505.rs b/core/lib/tests/local-request-content-type-issue-505.rs index 9d6490f1..542f7ee2 100644 --- a/core/lib/tests/local-request-content-type-issue-505.rs +++ b/core/lib/tests/local-request-content-type-issue-505.rs @@ -49,7 +49,7 @@ mod local_request_content_type_tests { use rocket::http::ContentType; fn rocket() -> Rocket { - rocket::ignite().mount("/", routes![rg_ct, data_has_ct, data_no_ct]) + rocket::build().mount("/", routes![rg_ct, data_has_ct, data_no_ct]) } #[test] diff --git a/core/lib/tests/local_request_private_cookie-issue-368.rs b/core/lib/tests/local_request_private_cookie-issue-368.rs index cf4b25e2..2a516f2a 100644 --- a/core/lib/tests/local_request_private_cookie-issue-368.rs +++ b/core/lib/tests/local_request_private_cookie-issue-368.rs @@ -18,7 +18,7 @@ mod tests { #[test] fn private_cookie_is_returned() { - let rocket = rocket::ignite().mount("/", routes![return_private_cookie]); + let rocket = rocket::build().mount("/", routes![return_private_cookie]); let client = Client::debug(rocket).unwrap(); let req = client.get("/").private_cookie(Cookie::new("cookie_name", "cookie_value")); @@ -30,7 +30,7 @@ mod tests { #[test] fn regular_cookie_is_not_returned() { - let rocket = rocket::ignite().mount("/", routes![return_private_cookie]); + let rocket = rocket::build().mount("/", routes![return_private_cookie]); let client = Client::debug(rocket).unwrap(); let req = client.get("/").cookie(Cookie::new("cookie_name", "cookie_value")); diff --git a/core/lib/tests/many-cookie-jars-at-once.rs b/core/lib/tests/many-cookie-jars-at-once.rs index 9dd1fa82..fc81b886 100644 --- a/core/lib/tests/many-cookie-jars-at-once.rs +++ b/core/lib/tests/many-cookie-jars-at-once.rs @@ -23,7 +23,7 @@ mod many_cookie_jars_tests { use rocket::local::blocking::Client; fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![multi_add, multi_get]) + rocket::build().mount("/", routes![multi_add, multi_get]) } #[test] diff --git a/core/lib/tests/mapped-base-issue-1262.rs b/core/lib/tests/mapped-base-issue-1262.rs index 9d9fcd23..e61abfcf 100644 --- a/core/lib/tests/mapped-base-issue-1262.rs +++ b/core/lib/tests/mapped-base-issue-1262.rs @@ -21,7 +21,7 @@ mod a { } fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", a::routes()).mount("/foo", a::routes()) + rocket::build().mount("/", a::routes()).mount("/foo", a::routes()) } mod mapped_base_tests { diff --git a/core/lib/tests/mount_point.rs b/core/lib/tests/mount_point.rs index d5ceaa0d..fc3e89a3 100644 --- a/core/lib/tests/mount_point.rs +++ b/core/lib/tests/mount_point.rs @@ -1,10 +1,10 @@ #[test] #[should_panic] fn bad_dynamic_mount() { - rocket::ignite().mount("", vec![]); + rocket::build().mount("", vec![]); } #[test] fn good_static_mount() { - rocket::ignite().mount("/abcdefghijkl_mno", vec![]); + rocket::build().mount("/abcdefghijkl_mno", vec![]); } diff --git a/core/lib/tests/nested-fairing-attaches.rs b/core/lib/tests/nested-fairing-attaches.rs index 4a00b95b..5c70fdfe 100644 --- a/core/lib/tests/nested-fairing-attaches.rs +++ b/core/lib/tests/nested-fairing-attaches.rs @@ -20,7 +20,7 @@ fn index(counter: State<'_, Counter>) -> String { } fn rocket() -> rocket::Rocket { - rocket::ignite() + rocket::build() .mount("/", routes![index]) .attach(AdHoc::on_launch("Outer", |rocket| async { let counter = Counter::default(); diff --git a/core/lib/tests/panic-handling.rs b/core/lib/tests/panic-handling.rs index a089da82..969420ec 100644 --- a/core/lib/tests/panic-handling.rs +++ b/core/lib/tests/panic-handling.rs @@ -27,7 +27,7 @@ fn pre_future_route<'r>(_: &'r Request<'_>, _: Data) -> HandlerFuture<'r> { } fn rocket() -> Rocket { - rocket::ignite() + rocket::build() .mount("/", routes![panic_route]) .mount("/", vec![Route::new(Method::Get, "/pre", pre_future_route)]) } diff --git a/core/lib/tests/precise-content-type-matching.rs b/core/lib/tests/precise-content-type-matching.rs index b6e9c92c..40f8443f 100644 --- a/core/lib/tests/precise-content-type-matching.rs +++ b/core/lib/tests/precise-content-type-matching.rs @@ -28,7 +28,7 @@ mod tests { use rocket::http::{Status, ContentType}; fn rocket() -> Rocket { - rocket::ignite() + rocket::build() .mount("/first", routes![specified, unspecified]) .mount("/second", routes![specified_json, specified_html]) } diff --git a/core/lib/tests/redirect_from_catcher-issue-113.rs b/core/lib/tests/redirect_from_catcher-issue-113.rs index a09c923b..12bda817 100644 --- a/core/lib/tests/redirect_from_catcher-issue-113.rs +++ b/core/lib/tests/redirect_from_catcher-issue-113.rs @@ -14,7 +14,7 @@ mod tests { #[test] fn error_catcher_redirect() { - let client = Client::debug(rocket::ignite().register("/", catchers![not_found])).unwrap(); + let client = Client::debug(rocket::build().register("/", catchers![not_found])).unwrap(); let response = client.get("/unknown").dispatch(); let location: Vec<_> = response.headers().get("location").collect(); diff --git a/core/lib/tests/replace-content-type-518.rs b/core/lib/tests/replace-content-type-518.rs index a985e2b2..df9339db 100644 --- a/core/lib/tests/replace-content-type-518.rs +++ b/core/lib/tests/replace-content-type-518.rs @@ -7,7 +7,7 @@ fn index(_data: rocket::Data) -> &'static str { "json" } fn other_index(_data: rocket::Data) -> &'static str { "other" } fn rocket() -> rocket::Rocket { - rocket::ignite() + rocket::build() .mount("/", rocket::routes![index, other_index]) .attach(AdHoc::on_request("Change CT", |req, _| Box::pin(async move { let need_ct = req.content_type().is_none(); diff --git a/core/lib/tests/route_guard.rs b/core/lib/tests/route_guard.rs index e8297fe1..2a88b24f 100644 --- a/core/lib/tests/route_guard.rs +++ b/core/lib/tests/route_guard.rs @@ -20,7 +20,7 @@ mod route_guard_tests { #[test] fn check_mount_path() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/first", routes![files]) .mount("/second", routes![files]); diff --git a/core/lib/tests/scoped-uri.rs b/core/lib/tests/scoped-uri.rs index 50971d94..9587a6f0 100644 --- a/core/lib/tests/scoped-uri.rs +++ b/core/lib/tests/scoped-uri.rs @@ -16,7 +16,7 @@ fn hello_name(name: String) -> String { } fn rocket() -> rocket::Rocket { - rocket::ignite() + rocket::build() .mount("/", routes![hello_name]) .mount("/", rocket::routes![inner::hello]) } diff --git a/core/lib/tests/segments-issues-41-86.rs b/core/lib/tests/segments-issues-41-86.rs index 702f874d..7ff1a6ee 100644 --- a/core/lib/tests/segments-issues-41-86.rs +++ b/core/lib/tests/segments-issues-41-86.rs @@ -33,7 +33,7 @@ mod tests { #[test] fn segments_works() { - let rocket = rocket::ignite() + let rocket = rocket::build() .mount("/", routes![test, two, one_two, none, dual]) .mount("/point", routes![test, two, one_two, dual]); let client = Client::debug(rocket).unwrap(); diff --git a/core/lib/tests/session-cookies-issue-1506.rs b/core/lib/tests/session-cookies-issue-1506.rs index d26a55e3..51662140 100644 --- a/core/lib/tests/session-cookies-issue-1506.rs +++ b/core/lib/tests/session-cookies-issue-1506.rs @@ -14,7 +14,7 @@ mod test_session_cookies { #[test] fn session_cookie_is_session() { - let rocket = rocket::ignite().mount("/", rocket::routes![index]); + let rocket = rocket::build().mount("/", rocket::routes![index]); let client = Client::debug(rocket).unwrap(); let response = client.get("/").dispatch(); diff --git a/core/lib/tests/timer-on-attach.rs b/core/lib/tests/timer-on-attach.rs index ee2629e5..7cc4fbe4 100644 --- a/core/lib/tests/timer-on-attach.rs +++ b/core/lib/tests/timer-on-attach.rs @@ -7,7 +7,7 @@ async fn test_await_timer_inside_attach() { rocket::tokio::time::sleep(std::time::Duration::from_millis(100)).await; } - rocket::ignite() + rocket::build() .attach(rocket::fairing::AdHoc::on_launch("1", |rocket| async { do_async_setup().await; rocket diff --git a/core/lib/tests/twice_managed_state.rs b/core/lib/tests/twice_managed_state.rs index 13e0f5b4..2517e40a 100644 --- a/core/lib/tests/twice_managed_state.rs +++ b/core/lib/tests/twice_managed_state.rs @@ -3,5 +3,5 @@ struct A; #[test] #[should_panic] fn twice_managed_state() { - let _ = rocket::ignite().manage(A).manage(A); + let _ = rocket::build().manage(A).manage(A); } diff --git a/core/lib/tests/uri-percent-encoding-issue-808.rs b/core/lib/tests/uri-percent-encoding-issue-808.rs index ec2cdb84..efb97ff0 100644 --- a/core/lib/tests/uri-percent-encoding-issue-808.rs +++ b/core/lib/tests/uri-percent-encoding-issue-808.rs @@ -21,7 +21,7 @@ fn uri_redirect() -> Redirect { } fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![hello, uri_redirect, raw_redirect]) + rocket::build().mount("/", routes![hello, uri_redirect, raw_redirect]) } diff --git a/examples/config/src/main.rs b/examples/config/src/main.rs index 38ec4d83..810337e6 100644 --- a/examples/config/src/main.rs +++ b/examples/config/src/main.rs @@ -23,7 +23,7 @@ fn read_config(rocket_config: &Config, app_config: State<'_, AppConfig>) -> Stri // and automatically by compiling with `--release`. #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", routes![read_config]) .attach(AdHoc::config::()) } diff --git a/examples/cookies/src/main.rs b/examples/cookies/src/main.rs index 61aafaf4..ed757086 100644 --- a/examples/cookies/src/main.rs +++ b/examples/cookies/src/main.rs @@ -15,7 +15,7 @@ fn index() -> Html<&'static str> { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .attach(Template::fairing()) .mount("/", routes![index]) .mount("/message", message::routes()) diff --git a/examples/databases/src/main.rs b/examples/databases/src/main.rs index 05eee959..39fb6859 100644 --- a/examples/databases/src/main.rs +++ b/examples/databases/src/main.rs @@ -11,7 +11,7 @@ mod rusqlite; #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .attach(sqlx::stage()) .attach(rusqlite::stage()) .attach(diesel_sqlite::stage()) diff --git a/examples/databases/src/tests.rs b/examples/databases/src/tests.rs index 8ca60636..b533579e 100644 --- a/examples/databases/src/tests.rs +++ b/examples/databases/src/tests.rs @@ -37,7 +37,7 @@ fn test(base: &str, stage: AdHoc) { // NOTE: If we had more than one test running concurently that dispatches // DB-accessing requests, we'd need transactions or to serialize all tests. - let client = Client::tracked(rocket::ignite().attach(stage)).unwrap(); + let client = Client::tracked(rocket::build().attach(stage)).unwrap(); // Clear everything from the database. assert_eq!(client.delete(base).dispatch().status(), Status::Ok); diff --git a/examples/error-handling/src/main.rs b/examples/error-handling/src/main.rs index 652ab253..a5f4816d 100644 --- a/examples/error-handling/src/main.rs +++ b/examples/error-handling/src/main.rs @@ -44,7 +44,7 @@ fn default_catcher(status: Status, req: &Request<'_>) -> status::Custom } fn rocket() -> rocket::Rocket { - rocket::ignite() + rocket::build() // .mount("/", routes![hello, hello]) // uncoment this to get an error .mount("/", routes![hello, forced_error]) .register("/", catchers![general_not_found, default_catcher]) diff --git a/examples/fairings/src/main.rs b/examples/fairings/src/main.rs index fc471068..79fb82e7 100644 --- a/examples/fairings/src/main.rs +++ b/examples/fairings/src/main.rs @@ -59,7 +59,7 @@ fn token(token: State<'_, Token>) -> String { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", routes![hello, token]) .attach(Counter::default()) .attach(AdHoc::try_on_launch("Token State", |rocket| async { diff --git a/examples/forms/src/main.rs b/examples/forms/src/main.rs index ca31ea7f..de0e56bc 100644 --- a/examples/forms/src/main.rs +++ b/examples/forms/src/main.rs @@ -82,7 +82,7 @@ fn submit<'r>(form: Form>>) -> (Status, Template) { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", routes![index, submit]) .attach(Template::fairing()) .mount("/", StaticFiles::from(crate_relative!("/static"))) diff --git a/examples/hello/src/main.rs b/examples/hello/src/main.rs index 4ad8418a..bdc22328 100644 --- a/examples/hello/src/main.rs +++ b/examples/hello/src/main.rs @@ -57,7 +57,7 @@ fn hello(lang: Option, opt: Options<'_>) -> String { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", routes![hello]) .mount("/hello", routes![world, mir]) .mount("/wave", routes![wave]) diff --git a/examples/manual-routing/src/main.rs b/examples/manual-routing/src/main.rs index db5f0ee7..4fb79477 100644 --- a/examples/manual-routing/src/main.rs +++ b/examples/manual-routing/src/main.rs @@ -104,7 +104,7 @@ fn rocket() -> _ { let not_found_catcher = Catcher::new(404, not_found_handler); - rocket::ignite() + rocket::build() .mount("/", vec![always_forward, hello, echo]) .mount("/upload", vec![get_upload, post_upload]) .mount("/hello", vec![name.clone()]) diff --git a/examples/pastebin/src/main.rs b/examples/pastebin/src/main.rs index d1caaa3c..996bf9c2 100644 --- a/examples/pastebin/src/main.rs +++ b/examples/pastebin/src/main.rs @@ -56,7 +56,7 @@ fn index() -> &'static str { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .manage(Absolute::parse(HOST).expect("valid host")) .mount("/", routes![index, upload, delete, retrieve]) } diff --git a/examples/responders/src/main.rs b/examples/responders/src/main.rs index 50d92ee8..97ca9aab 100644 --- a/examples/responders/src/main.rs +++ b/examples/responders/src/main.rs @@ -153,7 +153,7 @@ async fn custom(kind: Option) -> StoredData { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", routes![many_as, file, upload, delete]) .mount("/", routes![redir_root, redir_login, maybe_redir]) .mount("/", routes![xml, json, json_or_msgpack]) diff --git a/examples/serialization/src/main.rs b/examples/serialization/src/main.rs index 80fcbdf1..ca054acb 100644 --- a/examples/serialization/src/main.rs +++ b/examples/serialization/src/main.rs @@ -7,7 +7,7 @@ mod msgpack; #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .attach(json::stage()) .attach(msgpack::stage()) } diff --git a/examples/state/src/main.rs b/examples/state/src/main.rs index f253b94c..709bc744 100644 --- a/examples/state/src/main.rs +++ b/examples/state/src/main.rs @@ -8,7 +8,7 @@ mod managed_queue; #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .attach(request_local::stage()) .attach(managed_hit_count::stage()) .attach(managed_queue::stage()) diff --git a/examples/static-files/src/main.rs b/examples/static-files/src/main.rs index 75ca2a6d..ad6f2d40 100644 --- a/examples/static-files/src/main.rs +++ b/examples/static-files/src/main.rs @@ -21,7 +21,7 @@ mod manual { #[rocket::launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", rocket::routes![manual::second]) .mount("/", StaticFiles::from(crate_relative!("static"))) } diff --git a/examples/templating/src/main.rs b/examples/templating/src/main.rs index 06b2b58c..92d51287 100644 --- a/examples/templating/src/main.rs +++ b/examples/templating/src/main.rs @@ -15,7 +15,7 @@ fn index() -> Html<&'static str> { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", routes![index]) .mount("/tera", routes![tera::index, tera::hello]) .mount("/hbs", routes![hbs::index, hbs::hello, hbs::about]) diff --git a/examples/testing/src/async_required.rs b/examples/testing/src/async_required.rs index b8fe12ae..5766bbfb 100644 --- a/examples/testing/src/async_required.rs +++ b/examples/testing/src/async_required.rs @@ -10,7 +10,7 @@ async fn rendezvous(barrier: State<'_, Barrier>) -> &'static str { } pub fn rocket() -> rocket::Rocket { - rocket::ignite() + rocket::build() .mount("/", routes![rendezvous]) .attach(AdHoc::on_launch("Add Channel", |rocket| async { rocket.manage(Barrier::new(2)) diff --git a/examples/tls/src/main.rs b/examples/tls/src/main.rs index 48b5b4b1..9ec33254 100644 --- a/examples/tls/src/main.rs +++ b/examples/tls/src/main.rs @@ -10,5 +10,5 @@ fn hello() -> &'static str { #[launch] fn rocket() -> _ { // See `Rocket.toml` and `Cargo.toml` for TLS configuration. - rocket::ignite().mount("/", routes![hello]) + rocket::build().mount("/", routes![hello]) } diff --git a/examples/todo/src/main.rs b/examples/todo/src/main.rs index f946bbc0..83126386 100644 --- a/examples/todo/src/main.rs +++ b/examples/todo/src/main.rs @@ -104,7 +104,7 @@ async fn run_migrations(rocket: Rocket) -> Rocket { #[launch] fn rocket() -> Rocket { - rocket::ignite() + rocket::build() .attach(DbConn::fairing()) .attach(Template::fairing()) .attach(AdHoc::on_launch("Run Migrations", run_migrations)) diff --git a/examples/uuid/src/main.rs b/examples/uuid/src/main.rs index 9a6e38fa..fc7e0f54 100644 --- a/examples/uuid/src/main.rs +++ b/examples/uuid/src/main.rs @@ -30,7 +30,7 @@ fn rocket() -> _ { map.insert("4da34121-bc7d-4fc1-aee6-bf8de0795333".parse().unwrap(), "Bob"); map.insert("ad962969-4e3d-4de7-ac4a-2d86d6d10839".parse().unwrap(), "George"); - rocket::ignite() + rocket::build() .manage(People(map)) .mount("/", routes![people]) } diff --git a/site/guide/10-pastebin.md b/site/guide/10-pastebin.md index 05109c93..714792be 100644 --- a/site/guide/10-pastebin.md +++ b/site/guide/10-pastebin.md @@ -54,7 +54,7 @@ And finally, create a skeleton Rocket application to work off of in #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite() + rocket::build() } ``` @@ -111,7 +111,7 @@ to them. To mount the `index` route, modify the main function so that it reads: #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![index]) + rocket::build().mount("/", routes![index]) } ``` @@ -277,7 +277,7 @@ extension trait. Ensure that the route is mounted at the root path: #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![index, upload]) + rocket::build().mount("/", routes![index, upload]) } ``` @@ -341,7 +341,7 @@ Make sure that the route is mounted at the root path: #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![index, upload, retrieve]) + rocket::build().mount("/", routes![index, upload, retrieve]) } ``` diff --git a/site/guide/2-getting-started.md b/site/guide/2-getting-started.md index 60528e63..a5867c3f 100644 --- a/site/guide/2-getting-started.md +++ b/site/guide/2-getting-started.md @@ -72,7 +72,7 @@ fn index() -> &'static str { #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![index]) + rocket::build().mount("/", routes![index]) } ``` diff --git a/site/guide/3-overview.md b/site/guide/3-overview.md index 2f555d1d..383ba0c2 100644 --- a/site/guide/3-overview.md +++ b/site/guide/3-overview.md @@ -101,7 +101,7 @@ Before Rocket can dispatch requests to a route, the route needs to be _mounted_: # "hello, world!" # } -rocket::ignite().mount("/hello", routes![world]); +rocket::build().mount("/hello", routes![world]); ``` The `mount` method takes as input: @@ -110,7 +110,7 @@ The `mount` method takes as input: 2. A list of routes via the `routes!` macro: here, `routes![world]`, with multiple routes: `routes![a, b, c]`. -This creates a new `Rocket` instance via the `ignite` function and mounts the +This creates a new `Rocket` instance via the `build` function and mounts the `world` route to the `/hello` base path, making Rocket aware of the route. `GET` requests to `/hello/world` will be directed to the `world` function. @@ -125,7 +125,7 @@ any number of times, and routes can be reused by mount points: # "hello, world!" # } -rocket::ignite() +rocket::build() .mount("/hello", routes![world]) .mount("/hi", routes![world]); ``` @@ -156,7 +156,7 @@ fn world() -> &'static str { #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/hello", routes![world]) + rocket::build().mount("/hello", routes![world]) } ``` @@ -212,7 +212,7 @@ runtime but unlike `#[launch]`, allows _you_ to start the server: #[rocket::main] async fn main() { - rocket::ignite() + rocket::build() .mount("/hello", routes![world]) .launch() .await; diff --git a/site/guide/4-requests.md b/site/guide/4-requests.md index cc2095b9..3b5d5f2c 100644 --- a/site/guide/4-requests.md +++ b/site/guide/4-requests.md @@ -201,7 +201,7 @@ fn user_str(id: &str) { /* ... */ } #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![user, user_int, user_str]) + rocket::build().mount("/", routes![user, user_int, user_str]) } ``` @@ -1771,7 +1771,7 @@ looks like: # #[catch(404)] fn not_found(req: &Request) { /* .. */ } fn main() { - rocket::ignite().register("/", catchers![not_found]); + rocket::build().register("/", catchers![not_found]); } ``` @@ -1800,7 +1800,7 @@ fn foo_not_found() -> &'static str { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .register("/", catchers![general_not_found]) .register("/foo", catchers![foo_not_found]) } @@ -1846,7 +1846,7 @@ fn default_catcher(status: Status, request: &Request) { /* .. */ } #[launch] fn rocket() -> _ { - rocket::ignite().register("/", catchers![default_catcher]) + rocket::build().register("/", catchers![default_catcher]) } ``` diff --git a/site/guide/5-responses.md b/site/guide/5-responses.md index c8cda1e9..5c9087bb 100644 --- a/site/guide/5-responses.md +++ b/site/guide/5-responses.md @@ -395,7 +395,7 @@ fairings. To attach the template fairing, simply call #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", routes![/* .. */]) .attach(Template::fairing()) } diff --git a/site/guide/6-state.md b/site/guide/6-state.md index 6b1f5039..f986d19e 100644 --- a/site/guide/6-state.md +++ b/site/guide/6-state.md @@ -42,7 +42,7 @@ struct HitCount { count: AtomicUsize } -rocket::ignite().manage(HitCount { count: AtomicUsize::new(0) }); +rocket::build().manage(HitCount { count: AtomicUsize::new(0) }); ``` The `manage` method can be called any number of times as long as each call @@ -55,7 +55,7 @@ a `HitCount` value and a `Config` value, we can write: # type Config = &'static str; # let user_input = "input"; -rocket::ignite() +rocket::build() .manage(HitCount { count: AtomicUsize::new(0) }) .manage(Config::from(user_input)); ``` @@ -292,7 +292,7 @@ struct LogsDbConn(diesel::SqliteConnection); #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().attach(LogsDbConn::fairing()) + rocket::build().attach(LogsDbConn::fairing()) } ``` diff --git a/site/guide/7-fairings.md b/site/guide/7-fairings.md index cd861a49..82528123 100644 --- a/site/guide/7-fairings.md +++ b/site/guide/7-fairings.md @@ -55,7 +55,7 @@ fn rocket() -> rocket::Rocket { # let req_fairing = rocket::fairing::AdHoc::on_request("example", |_, _| Box::pin(async {})); # let res_fairing = rocket::fairing::AdHoc::on_response("example", |_, _| Box::pin(async {})); - rocket::ignite() + rocket::build() .attach(req_fairing) .attach(res_fairing) } @@ -217,7 +217,7 @@ prints a message indicating that the application has launched. The second named use rocket::fairing::AdHoc; use rocket::http::Method; -rocket::ignite() +rocket::build() .attach(AdHoc::on_liftoff("Liftoff Printer", |_| Box::pin(async move { println!("...annnddd we have liftoff!"); }))) diff --git a/site/guide/8-testing.md b/site/guide/8-testing.md index 58d09150..2260c67a 100644 --- a/site/guide/8-testing.md +++ b/site/guide/8-testing.md @@ -15,7 +15,7 @@ instance. Usage is straightforward: 1. Construct a `Rocket` instance that represents the application. ```rust,no_run - let rocket = rocket::ignite(); + let rocket = rocket::build(); # let _ = rocket; ``` @@ -23,7 +23,7 @@ instance. Usage is straightforward: ```rust,no_run # use rocket::local::blocking::Client; - # let rocket = rocket::ignite(); + # let rocket = rocket::build(); let client = Client::tracked(rocket).unwrap(); # let _ = client; ``` @@ -32,7 +32,7 @@ instance. Usage is straightforward: ```rust,no_run # use rocket::local::blocking::Client; - # let rocket = rocket::ignite(); + # let rocket = rocket::build(); # let client = Client::tracked(rocket).unwrap(); let req = client.get("/"); # let _ = req; @@ -42,7 +42,7 @@ instance. Usage is straightforward: ```rust,no_run # use rocket::local::blocking::Client; - # let rocket = rocket::ignite(); + # let rocket = rocket::build(); # let client = Client::tracked(rocket).unwrap(); # let req = client.get("/"); let response = req.dispatch(); @@ -99,7 +99,7 @@ These methods are typically used in combination with the `assert_eq!` or # use rocket::local::blocking::Client; use rocket::http::{ContentType, Status}; -# let rocket = rocket::ignite().mount("/", routes![hello]); +# let rocket = rocket::build().mount("/", routes![hello]); # let client = Client::debug(rocket).expect("valid rocket instance"); let mut response = client.get("/").dispatch(); @@ -124,7 +124,7 @@ fn hello() -> &'static str { #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![hello]) + rocket::build().mount("/", routes![hello]) } ``` @@ -165,7 +165,7 @@ testing: we _want_ our tests to panic when something goes wrong. ```rust # fn rocket() -> rocket::Rocket { -# rocket::ignite().reconfigure(rocket::Config::debug_default()) +# rocket::build().reconfigure(rocket::Config::debug_default()) # } # use rocket::local::blocking::Client; @@ -177,7 +177,7 @@ application's response: ```rust # fn rocket() -> rocket::Rocket { -# rocket::ignite().reconfigure(rocket::Config::debug_default()) +# rocket::build().reconfigure(rocket::Config::debug_default()) # } # use rocket::local::blocking::Client; # let client = Client::tracked(rocket()).expect("valid rocket instance"); @@ -201,7 +201,7 @@ We do this by checking the `Response` object directly: # use rocket::local::blocking::Client; use rocket::http::{ContentType, Status}; # -# let rocket = rocket::ignite().mount("/", routes![hello]); +# let rocket = rocket::build().mount("/", routes![hello]); # let client = Client::debug(rocket).expect("valid rocket instance"); # let mut response = client.get("/").dispatch(); @@ -220,7 +220,7 @@ fn hello() -> &'static str { } fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![hello]) + rocket::build().mount("/", routes![hello]) } # /* diff --git a/site/guide/9-configuration.md b/site/guide/9-configuration.md index 7f66d2a3..99a143dc 100644 --- a/site/guide/9-configuration.md +++ b/site/guide/9-configuration.md @@ -124,7 +124,7 @@ values are ignored. ## Default Provider Rocket's default configuration provider is [`Config::figment()`]; this is the -provider that's used when calling [`rocket::ignite()`]. +provider that's used when calling [`rocket::build()`]. The default figment merges, at a per-key level, and reads from the following sources, in ascending priority order: @@ -212,7 +212,7 @@ use serde::Deserialize; #[launch] fn rocket() -> _ { - let rocket = rocket::ignite(); + let rocket = rocket::build(); let figment = rocket.figment(); #[derive(Deserialize)] @@ -259,7 +259,7 @@ fn custom(config: State<'_, Config>) -> String { #[launch] fn rocket() -> _ { - rocket::ignite() + rocket::build() .mount("/", routes![custom]) .attach(AdHoc::config::()) } @@ -270,7 +270,7 @@ fn rocket() -> _ { ## Custom Providers A custom provider can be set via [`rocket::custom()`], which replaces calls to -[`rocket::ignite()`]. The configured provider can be built on top of +[`rocket::build()`]. The configured provider can be built on top of [`Config::figment()`], [`Config::default()`], both, or neither. The [Figment](@figment) documentation has full details on instantiating existing providers like [`Toml`] and [`Json`] as well as creating custom providers for @@ -356,4 +356,4 @@ or `APP_` environment variables, Rocket will make use of them. The application can also extract its configuration, done here via the `Adhoc::config()` fairing. [`rocket::custom()`]: @api/rocket/fn.custom.html -[`rocket::ignite()`]: @api/rocket/fn.custom.html +[`rocket::build()`]: @api/rocket/fn.custom.html diff --git a/site/index.toml b/site/index.toml index 8884a671..49e337bb 100644 --- a/site/index.toml +++ b/site/index.toml @@ -56,7 +56,7 @@ code = ''' #[launch] fn rocket() -> rocket::Rocket { - rocket::ignite().mount("/", routes![hello]) + rocket::build().mount("/", routes![hello]) } ''' text = ''' diff --git a/site/overview.toml b/site/overview.toml index fc15e986..06dbea9e 100644 --- a/site/overview.toml +++ b/site/overview.toml @@ -143,7 +143,7 @@ function, look like: ```rust #[launch] fn rocket() -> Rocket { - rocket::ignite().mount("/base", routes![index, another]) + rocket::build().mount("/base", routes![index, another]) } ```