diff options
Diffstat (limited to 'cli/tools/info.rs')
-rw-r--r-- | cli/tools/info.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cli/tools/info.rs b/cli/tools/info.rs index a81dcb55c..f494c8d00 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -311,7 +311,7 @@ impl NpmInfo { } for (specifier, _) in graph.specifiers() { - if let Ok(reference) = NpmPackageReference::from_specifier(&specifier) { + if let Ok(reference) = NpmPackageReference::from_specifier(specifier) { info .specifiers .insert(specifier.clone(), reference.req.clone()); @@ -421,9 +421,8 @@ impl<'a> GraphDisplayContext<'a> { } } writeln!(writer, "{} {}", colors::bold("type:"), root.media_type)?; - let modules = self.graph.modules(); let total_modules_size = - modules.iter().map(|m| m.size() as f64).sum::<f64>(); + self.graph.modules().map(|m| m.size() as f64).sum::<f64>(); let total_npm_package_size = self .npm_info .package_sizes @@ -431,7 +430,8 @@ impl<'a> GraphDisplayContext<'a> { .map(|s| *s as f64) .sum::<f64>(); let total_size = total_modules_size + total_npm_package_size; - let dep_count = modules.len() - 1 + self.npm_info.packages.len() + let dep_count = self.graph.modules().count() - 1 + + self.npm_info.packages.len() - self.npm_info.resolved_reqs.len(); writeln!( writer, @@ -595,9 +595,6 @@ impl<'a> GraphDisplayContext<'a> { ) -> TreeNode { self.seen.insert(specifier.to_string()); match err { - ModuleGraphError::InvalidSource(_, _) => { - self.build_error_msg(specifier, "(invalid source)") - } ModuleGraphError::InvalidTypeAssertion { .. } => { self.build_error_msg(specifier, "(invalid import assertion)") } |