fix: from_request_parts should be before body

This commit is contained in:
Dan Alekseev 2024-04-12 17:36:37 +04:00
parent 7279dee47f
commit 33452cd194
2 changed files with 2 additions and 2 deletions

View file

@ -73,7 +73,7 @@ pub fn transform_using_template(input: MacroInput, template_fn: ItemFn) -> ItemF
// add HxBoosted input to source_fn // add HxBoosted input to source_fn
let hx_boosted_input = template_fn.sig.inputs.first().unwrap().clone(); let hx_boosted_input = template_fn.sig.inputs.first().unwrap().clone();
source_fn.sig.inputs.push(hx_boosted_input); source_fn.sig.inputs.insert(0, hx_boosted_input);
// pop the last statement and wrap it with if-else // pop the last statement and wrap it with if-else
let source_stmt = source_fn.block.stmts.pop().unwrap(); let source_stmt = source_fn.block.stmts.pop().unwrap();

View file

@ -17,7 +17,7 @@ fn boosted_by() {
} }
}; };
let expected = quote! { let expected = quote! {
async fn index(Path(user_id): Path<u32>, axum_htmx::HxBoosted(boosted): axum_htmx::HxBoosted) -> Html<String> { async fn index(axum_htmx::HxBoosted(boosted): axum_htmx::HxBoosted, Path(user_id): Path<u32>) -> Html<String> {
let ctx = HomeTemplate { let ctx = HomeTemplate {
locale: "en".to_string(), locale: "en".to_string(),
}; };