From c7985b78584cf7d8e2560d96237a1b7f2be00855 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Tue, 29 Nov 2022 10:35:26 +0100 Subject: [PATCH] Fix wrong `From` impl for `Resource` (#1589) Really not sure how this got past the tests. --- axum-extra/CHANGELOG.md | 4 +++- axum-extra/src/routing/resource.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/axum-extra/CHANGELOG.md b/axum-extra/CHANGELOG.md index ec8eb03f..5884b8fc 100644 --- a/axum-extra/CHANGELOG.md +++ b/axum-extra/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning]. # Unreleased -- None. +- **fixed:** Fix wrong `From` impl for `Resource` ([#1589]) + +[#1589]: https://github.com/tokio-rs/axum/pull/1589 # 0.4.0 (25. November, 2022) diff --git a/axum-extra/src/routing/resource.rs b/axum-extra/src/routing/resource.rs index 19c6236a..ca1035f5 100644 --- a/axum-extra/src/routing/resource.rs +++ b/axum-extra/src/routing/resource.rs @@ -137,8 +137,8 @@ where } } -impl From> for Router { - fn from(resource: Resource) -> Self { +impl From> for Router { + fn from(resource: Resource) -> Self { resource.router } }