@@ -103,14 +103,14 @@ fn checked_compress(
103103/// out : bytes
104104/// A vector of 64 bytes representing the blake2b hash of the input data.
105105#[ pyfunction]
106- fn compress (
107- py : Python ,
106+ fn compress < ' py > (
107+ py : Python < ' py > ,
108108 rounds : usize ,
109109 starting_state : Vec < u64 > ,
110110 block : Vec < u64 > ,
111111 offset_counters : Vec < u64 > ,
112112 final_block_flag : bool ,
113- ) -> PyResult < PyObject > {
113+ ) -> PyResult < Bound < ' py , PyBytes > > {
114114 let result = checked_compress (
115115 rounds,
116116 & starting_state,
@@ -121,7 +121,7 @@ fn compress(
121121
122122 match result {
123123 Err ( msg) => Err ( PyValueError :: new_err ( msg) ) ,
124- Ok ( ok) => Ok ( PyBytes :: new ( py, & ok) . into ( ) ) ,
124+ Ok ( ok) => Ok ( PyBytes :: new ( py, & ok) ) ,
125125 }
126126}
127127
@@ -146,12 +146,12 @@ fn _decode_and_compress(input: Vec<u8>) -> Result<[u8; 64], String> {
146146/// out : bytes
147147/// A vector of 64 bytes representing the blake2b hash of the input data.
148148#[ pyfunction]
149- fn decode_and_compress ( py : Python , input : Vec < u8 > ) -> PyResult < PyObject > {
149+ fn decode_and_compress < ' py > ( py : Python < ' py > , input : Vec < u8 > ) -> PyResult < Bound < ' py , PyBytes > > {
150150 let result = _decode_and_compress ( input) ;
151151
152152 match result {
153153 Err ( msg) => Err ( PyValueError :: new_err ( msg) ) ,
154- Ok ( ok) => Ok ( PyBytes :: new ( py, & ok) . into ( ) ) ,
154+ Ok ( ok) => Ok ( PyBytes :: new ( py, & ok) ) ,
155155 }
156156}
157157
0 commit comments