aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorXavier Denis <[email protected]>2020-11-12 17:46:47 +0000
committerXavier Denis <[email protected]>2020-11-12 17:49:22 +0000
commit89ce6b6664c9451c3c6ab9446fcd40697c5b0267 (patch)
tree540db6fbe27b68fa6e778b51c22da898a586968c /crates
parent16443760a3f91259b50886c1625127530fed6986 (diff)
Address review comments
Diffstat (limited to 'crates')
-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 }