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 | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/crates/ide-db/src/lib.rs b/crates/ide-db/src/lib.rs index 6b72a30339..6180e3186c 100644 --- a/crates/ide-db/src/lib.rs +++ b/crates/ide-db/src/lib.rs @@ -112,7 +112,7 @@ impl Clone for RootDatabase { storage: self.storage.clone(), files: self.files.clone(), crates_map: self.crates_map.clone(), - nonce: Nonce::new(), + nonce: self.nonce, } } } @@ -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() } } |