Skip to content

Commit

Permalink
Use as_deref instead of clone to write font cached face ID
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethloeffler committed Aug 5, 2024
1 parent 29ced42 commit 6f262fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rbx_binary/src/serializer/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion rbx_types/src/attributes/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub(crate) fn write_attributes<W: Write>(
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(),
)?;
}

Expand Down

0 comments on commit 6f262fd

Please sign in to comment.