diff --git a/actix-web-httpauth/CHANGES.md b/actix-web-httpauth/CHANGES.md index 8f973f4f6..d307ad7d6 100644 --- a/actix-web-httpauth/CHANGES.md +++ b/actix-web-httpauth/CHANGES.md @@ -2,6 +2,7 @@ ## Unreleased +- Implement `From` for `BasicAuth`. - Minimum supported Rust version (MSRV) is now 1.68. ## 0.8.0 diff --git a/actix-web-httpauth/src/extractors/basic.rs b/actix-web-httpauth/src/extractors/basic.rs index 97890dda2..8b0f39ee8 100644 --- a/actix-web-httpauth/src/extractors/basic.rs +++ b/actix-web-httpauth/src/extractors/basic.rs @@ -89,6 +89,12 @@ impl BasicAuth { } } +impl From for BasicAuth { + fn from(basic: Basic) -> Self { + Self(basic) + } +} + impl FromRequest for BasicAuth { type Future = Ready>; type Error = AuthenticationError;