File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/rust/src/declarative_asn1 Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 33// for complete details.
44
55use asn1:: { SimpleAsn1Writable , Writer } ;
6- use pyo3:: types:: PyAnyMethods ;
6+ use pyo3:: types:: { PyAnyMethods , PyStringMethods } ;
77
88use crate :: declarative_asn1:: types:: { AnnotatedType , AnnotatedTypeObject , PrintableString , Type } ;
99
@@ -77,13 +77,14 @@ impl asn1::Asn1Writable for AnnotatedTypeObject<'_> {
7777 let val: & pyo3:: Bound < ' _ , PrintableString > = value
7878 . downcast ( )
7979 . map_err ( |_| asn1:: WriteError :: AllocationError ) ?;
80- let inner_str: pyo3 :: pybacked :: PyBackedStr = val
80+ let inner_str = val
8181 . get ( )
8282 . inner
83- . extract ( py)
83+ . bind ( py)
84+ . to_str ( )
8485 . map_err ( |_| asn1:: WriteError :: AllocationError ) ?;
8586 let printable_string: asn1:: PrintableString < ' _ > =
86- asn1:: PrintableString :: new ( & inner_str)
87+ asn1:: PrintableString :: new ( inner_str)
8788 . ok_or ( asn1:: WriteError :: AllocationError ) ?;
8889 write_value ( writer, & printable_string)
8990 }
You can’t perform that action at this time.
0 commit comments