From 4b59c3a538f27238b0466898f1b4ac69d1f9e778 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 28 Jan 2021 17:04:44 +0300 Subject: Make logger-based debugging more pleasant --- crates/project_model/src/workspace.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/project_model/src') diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs index bc5041e5a..559f4e7bf 100644 --- a/crates/project_model/src/workspace.rs +++ b/crates/project_model/src/workspace.rs @@ -51,6 +51,7 @@ pub enum ProjectWorkspace { impl fmt::Debug for ProjectWorkspace { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + // Make sure this isn't too verbose. match self { ProjectWorkspace::Cargo { cargo, sysroot, rustc, rustc_cfg } => f .debug_struct("Cargo") @@ -60,7 +61,7 @@ impl fmt::Debug for ProjectWorkspace { "n_rustc_compiler_crates", &rustc.as_ref().map_or(0, |rc| rc.packages().len()), ) - .field("rustc_cfg", rustc_cfg) + .field("n_rustc_cfg", &rustc_cfg.len()) .finish(), ProjectWorkspace::Json { project, sysroot, rustc_cfg } => { let mut debug_struct = f.debug_struct("Json"); @@ -68,7 +69,7 @@ impl fmt::Debug for ProjectWorkspace { if let Some(sysroot) = sysroot { debug_struct.field("n_sysroot_crates", &sysroot.crates().len()); } - debug_struct.field("rustc_cfg", rustc_cfg); + debug_struct.field("n_rustc_cfg", &rustc_cfg.len()); debug_struct.finish() } } -- cgit v1.2.3