Function take_section

Source
fn take_section(next_stop: &str, section_title: &str) -> Section
Expand description

Attempt to find and return a single Section from a Process, without invoking read_ebml

Why avoid read_ebml? If a library is full of “Section Reference” lines, then there are certain cases that could branch infinitely if read_ebml tries to expand every Section Reference found. If this function did what read_ebml does, then it could spawn itself ad infinitum, and possibly recursively, and possibly circularly.

Therefore, we’ll mimic what read_ebml does in this function, but only act on a single “Section” line (ignore “Section Reference” !!), being the first one found that matches the title we’re looking for.