message: refactor(cargo-tree): skip level earlier when exceeded
diff: @@ -371,6 +371,11 @@ fn print_dependencies<'a>(
  }
  }
  + // Current level exceeds maximum display depth. Skip.
  + if levels_continue.len() + 1 > max_display_depth as usize {
  + return;
  + }
  +
  let mut it = deps
  .iter()
  .filter(|dep| {
  @@ -389,7 +394,6 @@ fn print_dependencies<'a>(
  .peekable();
  while let Some(dependency) = it.next() {
  - if levels_continue.len() + 1 <= max_display_depth as usize {
  levels_continue.push(it.peek().is_some());
  print_node(
  config,
  @@ -408,4 +412,3 @@ fn print_dependencies<'a>(
  levels_continue.pop();
  }
  }
  -}
  