Skip to content

Commit

Permalink
Rocket 0.5 release! (#8)
Browse files Browse the repository at this point in the history
* Rocket 0.5 release!

* allow type_complexity
  • Loading branch information
stuarth authored Nov 21, 2023
1 parent fe8a511 commit 2f8f38c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Empty file.
10 changes: 6 additions & 4 deletions examples/rocket-svelte/src/main.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -17,7 +17,9 @@ fn hello() -> Inertia<Hello> {
// the component to render
"Hello",
// the props to pass our component
Hello { name: "world".into() },
Hello {
name: "world".into(),
},
)
}

Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/rocket.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down

0 comments on commit 2f8f38c

Please sign in to comment.