impl Criteria {
/// Returns a new output item whose children are all the (direct and
/// indirect) children of `item` that meet the criteria.
- pub fn apply(&self, item: Item) -> Item {
+ pub fn apply(&self, mut item: Item) -> Item {
fn take_children(item: &Item) -> Vec<&Item> {
item.details.children().iter().map(|item| &**item).collect()
}
}
}
fn unflatten_item(mut item: Item, include: &mut bit_vec::Iter, out: &mut Vec<Arc<Item>>) {
- let include_item = include.next().unwrap_or_default(); //XXX should just be unwrap
+ let include_item = include.next().unwrap();
if let Some(children) = item.details.mut_children() {
if !include_item {
unflatten_items(take(children), include, out);
}
let mut output = Vec::new();
- unflatten_item(item, &mut include.iter(), &mut output);
+ unflatten_items(
+ take(item.details.mut_children().unwrap()),
+ &mut include.iter(),
+ &mut output,
+ );
Heading(output).into_item().with_label("Output")
}
}
instances: Vec<usize>,
/// Include hidden objects in the output (by default, they are excluded)
- #[arg(long, required = false, action = ArgAction::Append)]
+ #[arg(long, required = false, action = ArgAction::Append, num_args = 0, value_parser = value_parser!(bool), default_missing_value = "true", default_value = "false")]
show_hidden: bool,
/// Include only objects that cause an error when read (by default, objects
/// with and without errors are included).
- #[arg(long, required = false, action = ArgAction::Append)]
+ #[arg(long, required = false, action = ArgAction::Append, num_args = 0, value_parser = value_parser!(bool), default_missing_value = "true", default_value = "false")]
errors: bool,
/// Include only XML and binary member names that match. Without any member