Skip to content

Commit

Permalink
cargo run --features=owned-tdoc working inside runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Nov 24, 2024
1 parent 8b24d51 commit 15485c0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion fastn-runtime/src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ impl HtmlData {
let doc = fastn_runtime::TDoc {
name: "foo", // Todo: Package name
definitions: o.definitions,
builtins: fastn_builtins::builtins(),
};

let output = fastn_runtime::get_all_asts(&doc, &o.content);
Expand Down
2 changes: 1 addition & 1 deletion fastn-runtime/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn main() {

let h = fastn_runtime::HtmlData::from_cd(fastn_resolved::CompiledDocument {
content: vec![c],
definitions: fastn_builtins::builtins().clone(),
definitions: Default::default(),
});

std::fs::write(std::path::PathBuf::from("output.html"), h.to_test_html()).unwrap();
Expand Down
3 changes: 1 addition & 2 deletions fastn-runtime/src/tdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use indexmap::IndexMap;
pub struct TDoc<'a> {
pub name: &'a str,
pub definitions: indexmap::IndexMap<String, fastn_resolved::Definition>,
pub builtins: &'static indexmap::IndexMap<String, fastn_resolved::Definition>,
}

impl TDoc<'_> {
Expand All @@ -13,7 +12,7 @@ impl TDoc<'_> {
return Some(definition);
}

if let Some(definition) = self.builtins.get(name) {
if let Some(definition) = fastn_builtins::builtins().get(name) {
return Some(definition);
}

Expand Down

0 comments on commit 15485c0

Please sign in to comment.