diff --git a/src/components/mod.rs b/src/components/mod.rs index 116ead7..2370585 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -261,13 +261,12 @@ pub mod route { state: AppState, params: Self::UrlParams, value: bool, - ) -> Result<(crate::Context, AppState, Self::UrlParams, bool), crate::Error>; + ) -> Result<(crate::Context, AppState, Self::UrlParams), crate::Error>; async fn response( ctx: &crate::Context, state: AppState, params: Self::UrlParams, - value: bool, ) -> Result, crate::Error>; async fn on( @@ -275,9 +274,8 @@ pub mod route { State(state): State, Path(path): Path, ) -> Result, crate::Error> { - let (ctx, state, params, value) = - ::set(user, state, path, true).await?; - ::response(&ctx, state, params, value).await + let (ctx, state, params) = ::set(user, state, path, true).await?; + ::response(&ctx, state, params).await } async fn off( @@ -285,9 +283,8 @@ pub mod route { State(state): State, Path(path): Path, ) -> Result, crate::Error> { - let (ctx, state, params, value) = - ::set(user, state, path, false).await?; - ::response(&ctx, state, params, value).await + let (ctx, state, params) = ::set(user, state, path, false).await?; + ::response(&ctx, state, params).await } fn router() -> axum::Router diff --git a/src/components/trips/todos/mod.rs b/src/components/trips/todos/mod.rs index 2d284c7..bed362e 100644 --- a/src/components/trips/todos/mod.rs +++ b/src/components/trips/todos/mod.rs @@ -1,5 +1,3 @@ -#![allow(unused_variables)] - pub mod list; pub use list::List; @@ -92,7 +90,10 @@ impl crud::Container for Container { type Reference = Reference; fn with_id(&self, id: Self::Id) -> Self::Reference { - Reference { id, container: *self } + Reference { + id, + container: *self, + } } } @@ -1011,18 +1012,17 @@ impl route::ToggleHtmx for StateUpdate { state: AppState, params: Self::UrlParams, value: bool, - ) -> Result<(crate::Context, AppState, Self::UrlParams, bool), crate::Error> { + ) -> Result<(crate::Context, AppState, Self::UrlParams), crate::Error> { let ctx = Context::build(current_user); ::set(&ctx, &state.database_pool, params.into(), value).await?; - Ok((ctx, state, params, value)) + Ok((ctx, state, params)) } async fn response( ctx: &Context, state: AppState, (trip_id, todo_id): Self::UrlParams, - value: bool, ) -> Result, crate::Error> { let todo_item = Todo::find( ctx,