aboutsummaryrefslogtreecommitdiff
path: root/crates/project_model/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/project_model/src')
-rw-r--r--crates/project_model/src/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/project_model/src/lib.rs b/crates/project_model/src/lib.rs
index 8e1cee0d6..4531b1928 100644
--- a/crates/project_model/src/lib.rs
+++ b/crates/project_model/src/lib.rs
@@ -46,7 +46,7 @@ impl fmt::Debug for ProjectWorkspace {
46 .field("n_sysroot_crates", &sysroot.crates().len()) 46 .field("n_sysroot_crates", &sysroot.crates().len())
47 .field( 47 .field(
48 "n_rustc_compiler_crates", 48 "n_rustc_compiler_crates",
49 &rustc.as_ref().map(|rc| rc.packages().len()).unwrap_or(0), 49 &rustc.as_ref().map_or(0, |rc| rc.packages().len()),
50 ) 50 )
51 .finish(), 51 .finish(),
52 ProjectWorkspace::Json { project, sysroot } => { 52 ProjectWorkspace::Json { project, sysroot } => {
@@ -314,8 +314,7 @@ impl ProjectWorkspace {
314 match self { 314 match self {
315 ProjectWorkspace::Json { project, .. } => project.n_crates(), 315 ProjectWorkspace::Json { project, .. } => project.n_crates(),
316 ProjectWorkspace::Cargo { cargo, sysroot, rustc } => { 316 ProjectWorkspace::Cargo { cargo, sysroot, rustc } => {
317 let rustc_package_len = rustc.as_ref().map(|rc| rc.packages().len()).unwrap_or(0); 317 let rustc_package_len = rustc.as_ref().map_or(0, |rc| rc.packages().len());
318 dbg!(rustc_package_len);
319 cargo.packages().len() + sysroot.crates().len() + rustc_package_len 318 cargo.packages().len() + sysroot.crates().len() + rustc_package_len
320 } 319 }
321 } 320 }