Skip to content

Commit

Permalink
Rename function to get_node_children_by_path for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
ZibanPirate committed Feb 15, 2025
1 parent 44cea48 commit 246b6b7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rust/Cargo.lock

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

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kuliya"
description = "A library for querying Algerian education dataset."
version = "0.1.2"
version = "0.1.3"
edition = "2021"
license = "MIT"

Expand Down
2 changes: 1 addition & 1 deletion rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub fn get_node_by_path(path: &str) -> Option<&Node> {{
}}
}}
pub fn get_children_by_path(path: &str) -> Vec<&Node> {{
pub fn get_node_children_by_path(path: &str) -> Vec<&Node> {{
match path {{
{} _ => vec![],
}}
Expand Down
2 changes: 1 addition & 1 deletion rust/src/static/_auto_generated/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,7 @@ pub fn get_node_by_path(path: &str) -> Option<&Node> {
}
}

pub fn get_children_by_path(path: &str) -> Vec<&Node> {
pub fn get_node_children_by_path(path: &str) -> Vec<&Node> {
match path {
"ua2aks" => vec![&UA2AKS_FLE, &UA2AKS_IT, &UA2AKS_IA, &UA2AKS_FSS, &UA2AKS_FSH, &UA2AKS_FALAOL],
"ua2aks/falaol" => vec![&UA2AKS_FALAOL_DTS, &UA2AKS_FALAOL_DART, &UA2AKS_FALAOL_DTRL, &UA2AKS_FALAOL_DALA],
Expand Down
12 changes: 12 additions & 0 deletions rust/src/static/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ pub fn get_node_by_path(path: &str) -> Option<&Node> {
_auto_generated::data::get_node_by_path(path)
}

/// Retrieves the children of a node by its path.
/// # Arguments
///
/// * `path` - A string slice that holds the path of the node.
///
/// # Returns
///
/// * `Vec<&Node>` - A vector of references to the children nodes.
pub fn get_node_children_by_path(path: &str) -> Vec<&Node> {
_auto_generated::data::get_node_children_by_path(path)
}

#[cfg(test)]
mod test {
use super::get_node_by_path;
Expand Down

0 comments on commit 246b6b7

Please sign in to comment.