Address review comments

This commit is contained in:
Xavier Denis 2020-11-12 18:46:47 +01:00
parent 16443760a3
commit 89ce6b6664
3 changed files with 17 additions and 3381 deletions

View File

@ -46,7 +46,7 @@ impl fmt::Debug for ProjectWorkspace {
.field("n_sysroot_crates", &sysroot.crates().len())
.field(
"n_rustc_compiler_crates",
&rustc.as_ref().map(|rc| rc.packages().len()).unwrap_or(0),
&rustc.as_ref().map_or(0, |rc| rc.packages().len()),
)
.finish(),
ProjectWorkspace::Json { project, sysroot } => {
@ -314,8 +314,7 @@ impl ProjectWorkspace {
match self {
ProjectWorkspace::Json { project, .. } => project.n_crates(),
ProjectWorkspace::Cargo { cargo, sysroot, rustc } => {
let rustc_package_len = rustc.as_ref().map(|rc| rc.packages().len()).unwrap_or(0);
dbg!(rustc_package_len);
let rustc_package_len = rustc.as_ref().map_or(0, |rc| rc.packages().len());
cargo.packages().len() + sysroot.crates().len() + rustc_package_len
}
}

File diff suppressed because it is too large Load Diff

View File

@ -688,11 +688,13 @@
"default": [],
"description": "Additional arguments to be passed to cargo for runnables such as tests or binaries.\nFor example, it may be '--release'"
},
"rust-analyzer.rustcSource" : {
"type": [ "null", "string" ],
"rust-analyzer.rustcSource": {
"type": [
"null",
"string"
],
"default": null,
"description": "Path to the rust compiler sources, for usage in rustc_private projects."
}
}
},