MCPcopy Create free account
hub / github.com/daisy/MathCAT / get_start_node

Function get_start_node

src/navigate.rs:380–392  ·  view source on GitHub ↗
(mathml: Element<'m>, nav_state: &RefMut<NavigationState>)

Source from the content-addressed store, hash-verified

378 });
379
380 fn get_start_node<'m>(mathml: Element<'m>, nav_state: &RefMut<NavigationState>) -> Result<Element<'m>> {
381 let start_node_id = match nav_state.top() {
382 None => mathml.attribute_value("id").unwrap().to_string(),
383 Some( (position, _) ) => position.current_node.clone(),
384 };
385
386 return match get_node_by_id(mathml, &start_node_id) {
387 Some(node) => Ok(node),
388 None => {
389 bail!("Internal Error: didn't find id '{}' while attempting to start navigation", &start_node_id);
390 }
391 };
392 }
393
394
395

Callers 1

apply_navigation_rulesFunction · 0.85

Calls 2

get_node_by_idFunction · 0.85
topMethod · 0.80

Tested by

no test coverage detected