File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
src/rust/src/declarative_asn1 Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ fn decode_bitstring<'a>(
135135 annotation : & Annotation ,
136136) -> ParseResult < pyo3:: Bound < ' a , BitString > > {
137137 let value = read_value :: < asn1:: BitString < ' a > > ( parser, & annotation. encoding ) ?;
138- let n_bits = value. as_bytes ( ) . len ( ) * 8 - ( value. padding_bits ( ) as usize ) ;
138+ let n_bits = value. as_bytes ( ) . len ( ) * 8 - usize :: from ( value. padding_bits ( ) ) ;
139139 check_size_constraint ( & annotation. size , n_bits, "BIT STRING" ) ?;
140140
141141 let data = pyo3:: types:: PyBytes :: new ( py, value. as_bytes ( ) ) . unbind ( ) ;
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ impl asn1::Asn1Writable for AnnotatedTypeObject<'_> {
191191 let bitstring: asn1:: BitString < ' _ > =
192192 asn1:: BitString :: new ( val. get ( ) . data . as_bytes ( py) , val. get ( ) . padding_bits )
193193 . ok_or ( asn1:: WriteError :: AllocationError ) ?;
194- let n_bits = bitstring. as_bytes ( ) . len ( ) * 8 - ( bitstring. padding_bits ( ) as usize ) ;
194+ let n_bits = bitstring. as_bytes ( ) . len ( ) * 8 - usize :: from ( bitstring. padding_bits ( ) ) ;
195195 check_size_constraint ( & annotation. size , n_bits, "BIT STRING" )
196196 . map_err ( |_| asn1:: WriteError :: AllocationError ) ?;
197197 write_value ( writer, & bitstring, encoding)
You can’t perform that action at this time.
0 commit comments