Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/lib.rs')
| -rw-r--r-- | crates/ide-db/src/lib.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crates/ide-db/src/lib.rs b/crates/ide-db/src/lib.rs index 190a754ab5..6180e3186c 100644 --- a/crates/ide-db/src/lib.rs +++ b/crates/ide-db/src/lib.rs @@ -402,10 +402,16 @@ impl<'a> MiniCore<'a> { impl std::fmt::Debug for MiniCore<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple("MiniCore") - // don't print the whole contents if they correspond to the default - .field(if self.0 == test_utils::MiniCore::RAW_SOURCE { &"<default>" } else { &self.0 }) - .finish() + let mut d = f.debug_tuple("MiniCore"); + if self.0 == test_utils::MiniCore::RAW_SOURCE { + // Don't print the whole contents if they correspond to the default. + // The `format_args!` makes it so that the output is + // `MiniCore(<default>)` and not `MiniCore("<default>"). + d.field(&format_args!("<default>")); + } else { + d.field(&self.0); + }; + d.finish() } } |