Fix builds.

This commit is contained in:
Stephen Chung
2023-02-25 20:58:40 +08:00
parent 51581cdef5
commit 5f09b5d9d9
2 changed files with 6 additions and 1 deletions

View File

@@ -326,7 +326,11 @@ impl Engine {
&self,
string: impl AsRef<str> + Into<ImmutableString>,
) -> ImmutableString {
locked_write(&self.interned_strings).get(string)
if let Some(ref interner) = self.interned_strings {
locked_write(interner).get(string)
} else {
string.into()
}
}
/// _(internals)_ Get an interned [string][ImmutableString].