From f4c9981474754ae0926def17f1416a1f6da88f52 Mon Sep 17 00:00:00 2001 From: Kenneth Loeffler Date: Mon, 5 Aug 2024 11:27:12 -0700 Subject: [PATCH] Use as_deref instead of clone when writing font cached face ID (#433) --- rbx_binary/src/serializer/state.rs | 2 +- rbx_types/src/attributes/writer.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rbx_binary/src/serializer/state.rs b/rbx_binary/src/serializer/state.rs index cd2c832f3..6133cdca5 100644 --- a/rbx_binary/src/serializer/state.rs +++ b/rbx_binary/src/serializer/state.rs @@ -798,7 +798,7 @@ impl<'dom, 'db, W: Write> SerializerState<'dom, 'db, W> { chunk.write_le_u16(value.weight.as_u16())?; chunk.write_u8(value.style.as_u8())?; chunk.write_string( - &value.cached_face_id.clone().unwrap_or_default(), + value.cached_face_id.as_deref().unwrap_or_default(), )?; } else { return type_mismatch(i, &rbx_value, "Font"); diff --git a/rbx_types/src/attributes/writer.rs b/rbx_types/src/attributes/writer.rs index 0f31d574f..fcbadb80a 100644 --- a/rbx_types/src/attributes/writer.rs +++ b/rbx_types/src/attributes/writer.rs @@ -95,7 +95,7 @@ pub(crate) fn write_attributes( write_string(&mut writer, &font.family)?; write_string( &mut writer, - &font.cached_face_id.clone().unwrap_or_default(), + font.cached_face_id.as_deref().unwrap_or_default(), )?; }