diff --git a/jwt-authorizer/src/layer.rs b/jwt-authorizer/src/layer.rs index 7e3884a..de97bce 100644 --- a/jwt-authorizer/src/layer.rs +++ b/jwt-authorizer/src/layer.rs @@ -209,8 +209,9 @@ where } #[async_trait] -impl IntoLayer for Vec> +impl IntoLayer for T where + T: IntoIterator> + Send + Sync, C: Clone + DeserializeOwned + Send + Sync, { async fn into_layer(self) -> Result, InitError> { diff --git a/jwt-authorizer/tests/tests.rs b/jwt-authorizer/tests/tests.rs index 74f7162..2a07020 100644 --- a/jwt-authorizer/tests/tests.rs +++ b/jwt-authorizer/tests/tests.rs @@ -352,7 +352,7 @@ mod tests { proteced_request_with_header(auths, header::COOKIE.as_str(), &format!("ccc={}", common::JWT_RSA1_OK)).await; assert_eq!(response.status(), StatusCode::OK); - let auths: Vec> = vec![ + let auths: [JwtAuthorizer; 2] = [ JwtAuthorizer::from_ec_pem("../config/ecdsa-public1.pem"), JwtAuthorizer::from_rsa_pem("../config/rsa-public1.pem").jwt_source(JwtSource::Cookie("ccc".to_owned())), ];