From face457867a257854a632ee9feaf48c3a6d02bc0 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Fri, 22 May 2020 13:07:24 -0400 Subject: [PATCH] remove allocation when formatting interned strings --- src/interner.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interner.rs b/src/interner.rs index b1255d6..4b9d27e 100644 --- a/src/interner.rs +++ b/src/interner.rs @@ -50,6 +50,6 @@ impl InternedString { impl Display for InternedString { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", self.resolve()) + STRINGS.with(|interner| write!(f, "{}", interner.borrow().resolve(&self.0))) } }