Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(unstable): deno info --json output #7417

Merged
merged 20 commits into from
Sep 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify code with unwraping
  • Loading branch information
bartossh committed Sep 13, 2020
commit e037529203a14b562c1cd3610965f236d0e8c601
13 changes: 5 additions & 8 deletions cli/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,14 @@ fn traverse_calc_size(
if let Some(module_graph_file) = module_graph.get(module_name) {
total_size = Some(module_graph_file.size());
for _module_name in module_graph_file.imports.iter() {
if let Some(_size) = traverse_calc_size(
total_size = if let Some(_size) = traverse_calc_size(
&_module_name.resolved_specifier.to_string(),
module_graph,
) {
match total_size {
Some(_total_size) => {
total_size = Some(_total_size + _size);
}
None => unreachable!(),
}
}
Some(total_size.unwrap() + _size)
} else {
unreachable!();
};
}
}
total_size
Expand Down