File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -33,19 +33,20 @@ pub(crate) struct CassBatchState {
33
33
34
34
#[ unsafe( no_mangle) ]
35
35
pub unsafe extern "C" fn cass_batch_new (
36
- type_ : CassBatchType ,
36
+ typ : CassBatchType ,
37
37
) -> CassOwnedExclusivePtr < CassBatch , CMut > {
38
- if let Ok ( batch_type) = make_batch_type ( type_) {
39
- BoxFFI :: into_ptr ( Box :: new ( CassBatch {
40
- state : Arc :: new ( CassBatchState {
41
- batch : Batch :: new ( batch_type) ,
42
- bound_values : Vec :: new ( ) ,
43
- } ) ,
44
- exec_profile : None ,
45
- } ) )
46
- } else {
47
- BoxFFI :: null_mut ( )
48
- }
38
+ let Ok ( batch_type) = make_batch_type ( typ) else {
39
+ tracing:: error!( "Provided invalid batch type to cass_batch_new: {typ:?}" ) ;
40
+ return BoxFFI :: null_mut ( ) ;
41
+ } ;
42
+
43
+ BoxFFI :: into_ptr ( Box :: new ( CassBatch {
44
+ state : Arc :: new ( CassBatchState {
45
+ batch : Batch :: new ( batch_type) ,
46
+ bound_values : Vec :: new ( ) ,
47
+ } ) ,
48
+ exec_profile : None ,
49
+ } ) )
49
50
}
50
51
51
52
#[ unsafe( no_mangle) ]
You can’t perform that action at this time.
0 commit comments