Skip to content

Commit 73b8541

Browse files
committed
Use PyStringMethods::to_cow instead of to_str
Signed-off-by: Facundo Tuesca <[email protected]>
1 parent bf37c10 commit 73b8541

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rust/src/declarative_asn1/encode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ impl asn1::Asn1Writable for AnnotatedTypeObject<'_> {
8181
.get()
8282
.inner
8383
.bind(py)
84-
.to_str()
84+
.to_cow()
8585
.map_err(|_| asn1::WriteError::AllocationError)?;
8686
let printable_string: asn1::PrintableString<'_> =
87-
asn1::PrintableString::new(inner_str)
87+
asn1::PrintableString::new(&inner_str)
8888
.ok_or(asn1::WriteError::AllocationError)?;
8989
write_value(writer, &printable_string)
9090
}

0 commit comments

Comments
 (0)