From c97a01616abd3af6511ceac28a01ac6d3023ae83 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 19 Nov 2023 17:42:43 +0100 Subject: More useful `Debug` impls --- crates/typst-library/src/meta/bibliography.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'crates/typst-library/src') diff --git a/crates/typst-library/src/meta/bibliography.rs b/crates/typst-library/src/meta/bibliography.rs index c258d19d..b84c330a 100644 --- a/crates/typst-library/src/meta/bibliography.rs +++ b/crates/typst-library/src/meta/bibliography.rs @@ -1,5 +1,6 @@ use std::collections::HashMap; use std::ffi::OsStr; +use std::fmt::{self, Debug, Formatter}; use std::hash::{Hash, Hasher}; use std::path::Path; use std::sync::Arc; @@ -296,7 +297,7 @@ impl LocalName for BibliographyElem { /// A loaded bibliography. #[ty] -#[derive(Debug, Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub struct Bibliography { map: Arc>, hash: u128, @@ -378,6 +379,12 @@ impl Bibliography { } } +impl Debug for Bibliography { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + f.debug_set().entries(self.map.keys()).finish() + } +} + impl Hash for Bibliography { fn hash(&self, state: &mut H) { self.hash.hash(state); -- cgit v1.2.3