From 38d07fece325dfab3f2cffdec6075852c01ceab4 Mon Sep 17 00:00:00 2001 From: Amit Upadhyay Date: Sat, 4 Nov 2023 11:43:01 +0530 Subject: [PATCH] test fixes and removed some un-needed lifetimes --- fastn-core/src/commands/serve.rs | 8 ++++---- fastn-core/src/package/package_doc.rs | 16 ++++++++-------- ftd/ftd-js.html | 3 +-- ftd/src/ftd2021/p1/parser.rs | 4 +++- ftd/src/js/ftd_test_helpers.rs | 1 + 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/fastn-core/src/commands/serve.rs b/fastn-core/src/commands/serve.rs index 8dc4aeb36a..be55481be9 100644 --- a/fastn-core/src/commands/serve.rs +++ b/fastn-core/src/commands/serve.rs @@ -18,8 +18,8 @@ fn handle_redirect( /// path: // /// #[tracing::instrument(skip_all)] -async fn serve_file<'m>( - config: &'m mut fastn_core::RequestConfig, +async fn serve_file( + config: &mut fastn_core::RequestConfig, path: &camino::Utf8Path, ) -> fastn_core::http::Response { if let Some(r) = handle_redirect(&config.config, path) { @@ -123,8 +123,8 @@ async fn serve_file<'m>( } } -async fn serve_cr_file<'m>( - req_config: &'m mut fastn_core::RequestConfig, +async fn serve_cr_file( + req_config: &mut fastn_core::RequestConfig, path: &camino::Utf8Path, cr_number: usize, ) -> fastn_core::http::Response { diff --git a/fastn-core/src/package/package_doc.rs b/fastn-core/src/package/package_doc.rs index 38d054ccaa..89996d6319 100644 --- a/fastn-core/src/package/package_doc.rs +++ b/fastn-core/src/package/package_doc.rs @@ -363,8 +363,8 @@ impl From for fastn_core::http::Response { } #[tracing::instrument(skip_all)] -pub(crate) async fn read_ftd<'m>( - config: &'m mut fastn_core::RequestConfig, +pub(crate) async fn read_ftd( + config: &mut fastn_core::RequestConfig, main: &fastn_core::Document, base_url: &str, download_assets: bool, @@ -385,8 +385,8 @@ pub(crate) async fn read_ftd<'m>( } #[tracing::instrument(name = "read_ftd_2022", skip_all)] -pub(crate) async fn read_ftd_2022<'m>( - config: &'m mut fastn_core::RequestConfig, +pub(crate) async fn read_ftd_2022( + config: &mut fastn_core::RequestConfig, main: &fastn_core::Document, base_url: &str, download_assets: bool, @@ -454,8 +454,8 @@ pub(crate) async fn read_ftd_2022<'m>( #[allow(clippy::await_holding_refcell_ref)] #[tracing::instrument(name = "read_ftd_2023", skip_all)] -pub(crate) async fn read_ftd_2023<'m>( - config: &'m mut fastn_core::RequestConfig, +pub(crate) async fn read_ftd_2023( + config: &mut fastn_core::RequestConfig, main: &fastn_core::Document, base_url: &str, download_assets: bool, @@ -529,8 +529,8 @@ pub(crate) async fn read_ftd_2023<'m>( Ok(FTDResult::Html(file_content.into())) } -pub(crate) async fn process_ftd<'m>( - config: &'m mut fastn_core::RequestConfig, +pub(crate) async fn process_ftd( + config: &mut fastn_core::RequestConfig, main: &fastn_core::Document, base_url: &str, build_static_files: bool, diff --git a/ftd/ftd-js.html b/ftd/ftd-js.html index 62934ad4c0..d9cad7d961 100644 --- a/ftd/ftd-js.html +++ b/ftd/ftd-js.html @@ -10,8 +10,7 @@ __fastn_package__ - __script_file__ - __extra_js__ + __script_file____extra_js__