Skip to content

Commit

Permalink
Merge pull request #54 from dzcode-io/hotfix/export-get_node_by_path
Browse files Browse the repository at this point in the history
hotfix: export `get_node_by_path` function from api module
  • Loading branch information
ZibanPirate authored Jan 7, 2024
2 parents 8ffd8c1 + c49c24d commit 099dc2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ use crate::node::model::{{Node, NodeName, NodeType, NodeTerms}};
{}
pub fn get_node_by_path(path: &str) -> Option<&Node> {{
match path {{
{}
_ => None,
{} _ => None,
}}
}}"##,
string_tree.0, string_tree.1
Expand All @@ -129,7 +128,9 @@ pub fn get_node_by_path(path: &str) -> Option<&Node> {{
fs::write("./src/_auto_generated/data.rs", data)?;
fs::write(
"./src/_auto_generated/mod.rs",
"// This is auto-generated. Do not edit manually\npub mod data;\n",
r#"// This is auto-generated. Do not edit manually
pub mod data;
"#,
)?;
Ok(())
}
Expand Down
7 changes: 5 additions & 2 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
mod _auto_generated;
pub mod api;
pub mod node;
mod api;
mod node;

pub use api::get_node_by_path::get_node_by_path;
pub use node::model::{Node, NodeName, NodeTerms, NodeType};

0 comments on commit 099dc2a

Please sign in to comment.