Function brane_ast::traversals::workflow_optimize::do_traversal

source ·
pub fn do_traversal(
    root: UnresolvedWorkflow,
) -> Result<UnresolvedWorkflow, Vec<AstError>>
Expand description

Optimizes the given UnresolvedWorkflow by collapsing successive linear edges into one edge.

§Arguments

  • root: The root node of the tree on which this compiler pass will be done.

§Returns

The same UnresolvedWorkflow but now (hopefully) with less edges.

§Errors

This pass doesn’t error, but might return one for convention purposes.

§Panics

This function may panic if any of the previous passes did not do its job, and the given UnresolvedWorkflow is ill-formed.