@@ -249,7 +249,7 @@ impl ZstdCompressionParameters {
249
249
}
250
250
251
251
/// Set parameters from a dictionary of options.
252
- fn set_parameters ( & self , kwargs : & PyDict ) -> PyResult < ( ) > {
252
+ fn set_parameters ( & self , kwargs : & Bound < ' _ , PyDict > ) -> PyResult < ( ) > {
253
253
unsafe {
254
254
zstd_sys:: ZSTD_CCtxParams_reset ( self . params ) ;
255
255
}
@@ -390,7 +390,7 @@ impl ZstdCompressionParameters {
390
390
_cls : Bound < ' _ , PyType > ,
391
391
py : Python ,
392
392
args : & Bound < ' _ , PyTuple > ,
393
- kwargs : Option < & PyDict > ,
393
+ kwargs : Option < & Bound < ' _ , PyDict > > ,
394
394
) -> PyResult < Self > {
395
395
if args. len ( ) != 1 {
396
396
return Err ( PyTypeError :: new_err ( format ! (
@@ -402,7 +402,7 @@ impl ZstdCompressionParameters {
402
402
let kwargs = if let Some ( v) = kwargs {
403
403
v. copy ( ) ?
404
404
} else {
405
- PyDict :: new ( py)
405
+ PyDict :: new_bound ( py)
406
406
} ;
407
407
408
408
let level = args. get_item ( 0 ) ?. extract :: < i32 > ( ) ?;
@@ -446,12 +446,16 @@ impl ZstdCompressionParameters {
446
446
kwargs. set_item ( "strategy" , compression_params. strategy as u32 ) ?;
447
447
}
448
448
449
- Self :: new ( py, & PyTuple :: empty_bound ( py) , Some ( kwargs) )
449
+ Self :: new ( py, & PyTuple :: empty_bound ( py) , Some ( & kwargs) )
450
450
}
451
451
452
452
#[ new]
453
453
#[ pyo3( signature = ( * _args, * * kwargs) ) ]
454
- fn new ( py : Python , _args : & Bound < ' _ , PyTuple > , kwargs : Option < & PyDict > ) -> PyResult < Self > {
454
+ fn new (
455
+ py : Python ,
456
+ _args : & Bound < ' _ , PyTuple > ,
457
+ kwargs : Option < & Bound < ' _ , PyDict > > ,
458
+ ) -> PyResult < Self > {
455
459
let params = unsafe { zstd_sys:: ZSTD_createCCtxParams ( ) } ;
456
460
if params. is_null ( ) {
457
461
return Err ( PyMemoryError :: new_err ( "unable to create ZSTD_CCtx_params" ) ) ;
@@ -462,7 +466,7 @@ impl ZstdCompressionParameters {
462
466
let kwargs = if let Some ( v) = kwargs {
463
467
v. copy ( ) ?
464
468
} else {
465
- PyDict :: new ( py)
469
+ PyDict :: new_bound ( py)
466
470
} ;
467
471
468
472
instance. set_parameters ( & kwargs) ?;
0 commit comments