Skip to content

Commit 42033ae

Browse files
Avoid the clone
1 parent a6888fd commit 42033ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sentry-types/src/protocol/attachment.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ impl Attachment {
7272
r#"{{"type":"attachment","length":{length},"filename":"{filename}","attachment_type":"{at}","content_type":"{ct}"}}"#,
7373
filename = self.filename,
7474
length = self.buffer.len(),
75-
at = self.ty.clone().unwrap_or_default().as_str(),
75+
at = self
76+
.ty
77+
.as_ref()
78+
.unwrap_or(&AttachmentType::default())
79+
.as_str(),
7680
ct = self
7781
.content_type
7882
.as_ref()

0 commit comments

Comments
 (0)