Skip to content

Commit

Permalink
test fixes and removed some un-needed lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Nov 4, 2023
1 parent 5305000 commit 38d07fe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
8 changes: 4 additions & 4 deletions fastn-core/src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ fn handle_redirect(
/// path: /<file-name>/
///
#[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) {
Expand Down Expand Up @@ -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 {
Expand Down
16 changes: 8 additions & 8 deletions fastn-core/src/package/package_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ impl From<FTDResult> 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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions ftd/ftd-js.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion ftd/src/ftd2021/p1/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,13 +815,15 @@ mod test {
),
super::Section::with_name("hello")
.add_sub_section(super::SubSection::with_name("realm.rr.step.body").and_body(
r#"
&indoc!(
r#"
{
"body": "-- h0: Hello World\n\n-- markup:\n\ndemo cr 1\n",
"kind": "content",
"track": "amitu/index",
"version": "2020-11-16T04:13:14.642892+00:00"
}"#
)
))
.list()
);
Expand Down
1 change: 1 addition & 0 deletions ftd/src/js/ftd_test_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ fn p(s: &str, t: &str, fix: bool, manual: bool, script: bool, file_location: &st
);

ftd::ftd_js_html()
.replace("__extra_js__", "")
.replace("__fastn_package__", dummy_package_data.as_str())
.replace(
"__js_script__",
Expand Down

0 comments on commit 38d07fe

Please sign in to comment.