Fix clippy errors, update deps
Some checks failed
Build Crate / build (push) Failing after 52s

This commit is contained in:
2024-08-18 19:56:00 -04:00
parent ffe6a771d2
commit d29da66536
10 changed files with 27 additions and 16 deletions

View File

@@ -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

View File

@@ -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)'] }

View File

@@ -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<G> {
let children = children.call(cx);

View File

@@ -1,5 +1,6 @@
mod components;
mod endpoints;
#[allow(unused_imports)]
mod entity;
mod error_views;
#[cfg(engine)]

View File

@@ -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<user::Model> {
async fn post_user(_user: String) -> Json<user::Model> {
// Update the store with the new match
todo!()
}
async fn post_match(_user: String) -> Json<game::Model> {
// Update the store with the new match
todo!()
}

View File

@@ -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")

View File

@@ -5,8 +5,7 @@ use serde::{Deserialize, Serialize};
cfg_if::cfg_if! {
if #[cfg(engine)] {
use std::thread;
use std::ops::Deref;
}
}

View File

@@ -4,7 +4,7 @@ use sycamore::prelude::*;
fn index_page<G: Html>(cx: Scope) -> View<G> {
view! { cx,
Layout(title = "Index") {
Layout(_title = "Index") {
// Anything we put in here will be rendered inside the `<main>` block of the layout
p { "Hello World!" }
br {}

View File

@@ -9,7 +9,7 @@ struct PageState {}
fn one_v_one_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View<G> {
view! { cx,
Layout(title = "1v1 Leaderboard") {
Layout(_title = "1v1 Leaderboard") {
p { "leaderboard" }
}
}

View File

@@ -9,10 +9,10 @@ use sycamore::prelude::*;
struct PageState {}
fn overall_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View<G> {
let global_state = Reactor::<G>::from_cx(cx).get_global_state::<AppStateRx>(cx);
let _global_state = Reactor::<G>::from_cx(cx).get_global_state::<AppStateRx>(cx);
view! { cx,
Layout(title = "Overall Leaderboard") {
Layout(_title = "Overall Leaderboard") {
ul {
(View::new_fragment(
vec![],