diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index f28d535..bdf7e78 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -46,10 +46,10 @@ jobs: - name: Build the project run: perseus --wasm-opt-version version_118 deploy --verbose - name: Run clippy for server - run: RUSTFLAGS="--cfg=engine" cargo clippy --all -- -D warnings + run: RUSTFLAGS="--cfg=engine" cargo clippy --all --future-incompat-report -- -D warnings continue-on-error: true - name: Run clippy for frontend - run: RUSTFLAGS="--cfg=client" cargo clippy --all -- -D warnings + run: RUSTFLAGS="--cfg=client" cargo clippy --all --future-incompat-report -- -D warnings continue-on-error: true - name: Check for formatting issues run: cargo fmt --check diff --git a/Cargo.toml b/Cargo.toml index 200f3fd..fb1b76d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,9 +39,9 @@ sea-orm = { version = "0.12.0", features = [ ] } [target.'cfg(client)'.dependencies] -wasm-bindgen = "0.2" +wasm-bindgen = "0.2.93" reqwest = { version = "0.11", features = ["json"] } -sea-orm = { version = "0.12.0" } +sea-orm = { version = "0.1" } [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(engine)', 'cfg(client)'] } diff --git a/src/components/layout.rs b/src/components/layout.rs index a561828..7c37254 100644 --- a/src/components/layout.rs +++ b/src/components/layout.rs @@ -2,14 +2,17 @@ use sycamore::prelude::*; #[derive(Prop)] pub struct LayoutProps<'a, G: Html> { - pub title: &'a str, + pub _title: &'a str, pub children: Children<'a, G>, } #[component] pub fn Layout<'a, G: Html>( cx: Scope<'a>, - LayoutProps { title: _, children }: LayoutProps<'a, G>, + LayoutProps { + _title: _, + children, + }: LayoutProps<'a, G>, ) -> View { let children = children.call(cx); diff --git a/src/main.rs b/src/main.rs index 25f1752..8d738bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ mod components; mod endpoints; +#[allow(unused_imports)] mod entity; mod error_views; #[cfg(engine)] diff --git a/src/server/routes.rs b/src/server/routes.rs index f343cbf..b65cb22 100644 --- a/src/server/routes.rs +++ b/src/server/routes.rs @@ -1,5 +1,8 @@ // (Server only) Routes -use crate::{endpoints::USER, entity::user}; +use crate::{ + endpoints::{MATCH, USER}, + entity::{game, user}, +}; use axum::{ extract::Json, routing::{post, Router}, @@ -7,10 +10,15 @@ use axum::{ pub fn register_routes(app: Router) -> Router { let app = app.route(USER, post(post_user)); - app + app.route(MATCH, post(post_match)) } -async fn post_user(user: String) -> Json { +async fn post_user(_user: String) -> Json { + // Update the store with the new match + todo!() +} + +async fn post_match(_user: String) -> Json { // Update the store with the new match todo!() } diff --git a/src/templates/add_game_form.rs b/src/templates/add_game_form.rs index d7f20b6..673bfed 100644 --- a/src/templates/add_game_form.rs +++ b/src/templates/add_game_form.rs @@ -40,7 +40,7 @@ fn add_game_form_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, state: &'a PageStat }; view! { cx, - Layout(title = "Add Game Results") { + Layout(_title = "Add Game Results") { div (class = "flex flex-wrap") { select { option (value="red") diff --git a/src/templates/global_state.rs b/src/templates/global_state.rs index 5fd4e1f..c6a7b2d 100644 --- a/src/templates/global_state.rs +++ b/src/templates/global_state.rs @@ -5,8 +5,7 @@ use serde::{Deserialize, Serialize}; cfg_if::cfg_if! { if #[cfg(engine)] { - use std::thread; - use std::ops::Deref; + } } diff --git a/src/templates/index.rs b/src/templates/index.rs index ff585f8..0228503 100644 --- a/src/templates/index.rs +++ b/src/templates/index.rs @@ -4,7 +4,7 @@ use sycamore::prelude::*; fn index_page(cx: Scope) -> View { view! { cx, - Layout(title = "Index") { + Layout(_title = "Index") { // Anything we put in here will be rendered inside the `
` block of the layout p { "Hello World!" } br {} diff --git a/src/templates/one_v_one_board.rs b/src/templates/one_v_one_board.rs index cccbe82..4a31bec 100644 --- a/src/templates/one_v_one_board.rs +++ b/src/templates/one_v_one_board.rs @@ -9,7 +9,7 @@ struct PageState {} fn one_v_one_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View { view! { cx, - Layout(title = "1v1 Leaderboard") { + Layout(_title = "1v1 Leaderboard") { p { "leaderboard" } } } diff --git a/src/templates/overall_board.rs b/src/templates/overall_board.rs index db45c2d..8c4f887 100644 --- a/src/templates/overall_board.rs +++ b/src/templates/overall_board.rs @@ -9,10 +9,10 @@ use sycamore::prelude::*; struct PageState {} fn overall_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View { - let global_state = Reactor::::from_cx(cx).get_global_state::(cx); + let _global_state = Reactor::::from_cx(cx).get_global_state::(cx); view! { cx, - Layout(title = "Overall Leaderboard") { + Layout(_title = "Overall Leaderboard") { ul { (View::new_fragment( vec![],