diff --git a/crates/oapi/src/rapidoc/mod.rs b/crates/oapi/src/rapidoc/mod.rs index 69a2e746c..ee112018e 100644 --- a/crates/oapi/src/rapidoc/mod.rs +++ b/crates/oapi/src/rapidoc/mod.rs @@ -96,26 +96,26 @@ impl RapiDoc { impl Handler for RapiDoc { async fn handle(&self, _req: &mut Request, _depot: &mut Depot, res: &mut Response, _ctrl: &mut FlowCtrl) { let keywords = self - .keywords - .as_ref() - .map(|s| { - format!( - "", - s.split(',').map(|s| s.trim()).collect::>().join(",") - ) - }) - .unwrap_or_default(); - let description = self - .description - .as_ref() - .map(|s| format!("", s)) - .unwrap_or_default(); + .keywords + .as_ref() + .map(|s| { + format!( + "", + s.split(',').map(|s| s.trim()).collect::>().join(",") + ) + }) + .unwrap_or_default(); + let description = self + .description + .as_ref() + .map(|s| format!("", s)) + .unwrap_or_default(); let html = INDEX_TMPL - .replacen("{{lib_url}}", &self.lib_url, 1) .replacen("{{spec_url}}", &self.spec_url, 1) - .replacen("{{title}}", &self.title, 1) + .replacen("{{lib_url}}", &self.lib_url, 1) + .replacen("{{description}}", &description, 1) .replacen("{{keywords}}", &keywords, 1) - .replacen("{{description}}", &description, 1); + .replacen("{{title}}", &self.title, 1); res.render(Text::Html(html)); } } diff --git a/crates/oapi/src/redoc/mod.rs b/crates/oapi/src/redoc/mod.rs index 7700a2430..5a406e58d 100644 --- a/crates/oapi/src/redoc/mod.rs +++ b/crates/oapi/src/redoc/mod.rs @@ -4,9 +4,9 @@ //! //! [salvo]: //! -use std::borrow::Cow; use salvo_core::writing::Text; use salvo_core::{async_trait, Depot, FlowCtrl, Handler, Request, Response, Router}; +use std::borrow::Cow; const INDEX_TMPL: &str = r#" @@ -17,7 +17,6 @@ const INDEX_TMPL: &str = r#" {{description}} -