diff --git a/Cargo.toml b/Cargo.toml index 536dde9..273d82a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rocket = { version = "0.5.0-rc.1", features = ["json"], optional = true } +rocket = { version = "0.5", features = ["json"], optional = true } serde = { version = "1", features = ["derive"] } serde_json = "1.0" tracing = "0.1" diff --git a/examples/rocket-svelte/public/.gitkeep b/examples/rocket-svelte/public/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/examples/rocket-svelte/src/main.rs b/examples/rocket-svelte/src/main.rs index 932dfb4..49f4ab0 100644 --- a/examples/rocket-svelte/src/main.rs +++ b/examples/rocket-svelte/src/main.rs @@ -1,10 +1,10 @@ #[macro_use] extern crate rocket; -use inertia_rs::rocket::{Inertia, VersionFairing}; +use inertia_rs::{rocket::VersionFairing, Inertia}; +use rocket::fs::FileServer; use rocket::response::Responder; use rocket_dyn_templates::Template; -use rocket::fs::FileServer; #[derive(serde::Serialize)] struct Hello { @@ -17,7 +17,9 @@ fn hello() -> Inertia { // the component to render "Hello", // the props to pass our component - Hello { name: "world".into() }, + Hello { + name: "world".into(), + }, ) } @@ -27,7 +29,7 @@ fn rocket() -> _ { .mount("/", routes![hello]) .attach(Template::fairing()) .mount("/public", FileServer::from(rocket::fs::relative!("public"))) - // Version fairing is configured with current asset version, and a + // Version fairing is configured with current asset version, and a // closure to generate the html template response .attach(VersionFairing::new("1", |request, ctx| { Template::render("app", ctx).respond_to(request) diff --git a/src/rocket.rs b/src/rocket.rs index c3abed6..d377b17 100644 --- a/src/rocket.rs +++ b/src/rocket.rs @@ -1,3 +1,5 @@ +#![allow(clippy::type_complexity)] + use super::{Inertia, X_INERTIA, X_INERTIA_LOCATION, X_INERTIA_VERSION}; use rocket::fairing::{Fairing, Info, Kind}; use rocket::http::{self, Method};