fix: refactor syntax to correctly include VertexInstance

This commit is contained in:
drbh 2024-02-20 15:26:44 +00:00
parent df23062574
commit 3fe6c45132

View File

@ -1037,7 +1037,12 @@ pub async fn run(
};
// Define VertextApiDoc conditionally only if the "google" feature is enabled
let doc = {
// avoid `mut` if possible
#[cfg(feature = "google")]
{
use crate::VertexInstance;
#[derive(OpenApi)]
#[openapi(
paths(vertex_compatibility),
@ -1045,12 +1050,8 @@ pub async fn run(
)]
struct VertextApiDoc;
let doc = {
// avoid `mut` if possible
#[cfg(feature = "google")]
{
// limiting mutability to the smallest scope necessary
let mut doc = doc;
let mut doc = ApiDoc::openapi();
doc.merge(VertextApiDoc::openapi());
doc
}