Add 'must_use' to 'Rocket'.

Closes #2146.
This commit is contained in:
Sergio Benitez 2022-04-19 13:03:58 -07:00
parent 49d138de14
commit 82cd53de36
3 changed files with 4 additions and 3 deletions

View File

@ -107,6 +107,7 @@ use crate::log::PaintExt;
/// rocket::build()
/// }
/// ```
#[must_use]
pub struct Rocket<P: Phase>(pub(crate) P::State);
impl Rocket<Build> {

View File

@ -1,10 +1,10 @@
#[test]
#[should_panic]
fn bad_dynamic_mount() {
rocket::build().mount("<name>", vec![]);
let _ = rocket::build().mount("<name>", vec![]);
}
#[test]
fn good_static_mount() {
rocket::build().mount("/abcdefghijkl_mno", vec![]);
let _ = rocket::build().mount("/abcdefghijkl_mno", vec![]);
}

View File

@ -7,7 +7,7 @@ async fn test_await_timer_inside_attach() {
rocket::tokio::time::sleep(std::time::Duration::from_millis(100)).await;
}
rocket::build()
let _ = rocket::build()
.attach(rocket::fairing::AdHoc::on_ignite("1", |rocket| async {
do_async_setup().await;
rocket