Remove unneeded &self param

This commit is contained in:
Tristan D. 2025-03-08 01:30:34 +01:00
parent e3c8bfb1ae
commit 65ecce069e
Signed by: tristan
SSH key fingerprint: SHA256:9oFM1J63hYWJjCnLG6C0fxBS15rwNcWwdQNMOHYKJ/4
5 changed files with 8 additions and 8 deletions

4
Cargo.lock generated
View file

@ -101,7 +101,7 @@ dependencies = [
[[package]] [[package]]
name = "axum-controller" name = "axum-controller"
version = "0.1.1" version = "0.2.0"
dependencies = [ dependencies = [
"axum", "axum",
"axum-controller-macros", "axum-controller-macros",
@ -114,7 +114,7 @@ dependencies = [
[[package]] [[package]]
name = "axum-controller-macros" name = "axum-controller-macros"
version = "0.1.1" version = "0.2.0"
dependencies = [ dependencies = [
"axum", "axum",
"prettyplease", "prettyplease",

View file

@ -1,15 +1,15 @@
[workspace] [workspace]
members = ["axum-controller", "axum-controller-macros"] members = ["axum-controller", "axum-controller-macros"]
resolver = "2" resolver = "3"
[workspace.package] [workspace.package]
authors = ["Tristan Druyen <ek36g2vcc@mozmail.com>"] authors = ["Tristan Druyen <ek36g2vcc@mozmail.com>"]
categories = ["web-programming"] categories = ["web-programming"]
description = "A controller & route macro for axum" description = "Helper macro's for better readability of axum handlers"
edition = "2024" edition = "2024"
homepage = "https://git.vlt81.de/vault81/axum-controller" homepage = "https://git.vlt81.de/vault81/axum-controller"
keywords = ["axum", "controller", "macro", "routing"] keywords = ["axum", "controller", "macro", "routing"]
license = "AGPL-3.0-or-later" license = "AGPL-3.0-or-later"
readme = "README.md" readme = "README.md"
repository = "https://git.vlt81.de/vault81/axum-controller" repository = "https://git.vlt81.de/vault81/axum-controller"
version = "0.1.1" version = "0.2.0"

View file

@ -151,7 +151,7 @@ pub fn controller(attr: TokenStream, item: TokenStream) -> TokenStream {
// one where it's #state // one where it's #state
let from_controller_into_router_impl = quote! { let from_controller_into_router_impl = quote! {
impl #struct_name { impl #struct_name {
fn into_router(&self, state: #state) -> axum::Router<#state> { fn into_router(state: #state) -> axum::Router<#state> {
let __nested_router = axum::Router::new() let __nested_router = axum::Router::new()
#(#route_calls)* #(#route_calls)*
#(#middleware_calls)* #(#middleware_calls)*

View file

@ -14,7 +14,7 @@ repository.workspace = true
version.workspace = true version.workspace = true
[dependencies] [dependencies]
axum-controller-macros = { path = "../axum-controller-macros", version = "0.1.1" } axum-controller-macros = { path = "../axum-controller-macros", version = "0.2.0" }
axum-typed-routing = { path = "../vendor/axum-typed-routing", version = "0.2.0" } axum-typed-routing = { path = "../vendor/axum-typed-routing", version = "0.2.0" }
[dev-dependencies] [dev-dependencies]

View file

@ -39,5 +39,5 @@ impl ExampleController {
} }
fn main() { fn main() {
let _router: axum::Router<AppState>= ExampleController.into_router(AppState()); let _router: axum::Router<AppState> = ExampleController::into_router(AppState());
} }