Xeiron / sndfile.rs

A safe rust wrapper of libsndfile
MIT License
10 stars 7 forks source link

Prevent unused warnings by dropping Box::from_raw #7

Open nils-werner opened 1 year ago

nils-werner commented 1 year ago

Using Box::from_raw() and ignoring the return value produces a warning:

warning: unused return value of `Box::<T>::from_raw` that must be used                                                                                                                          
   --> src/lib.rs:418:11                                                                                                                                                                        
    |                                                                                                                                                                                           
418 |           Box::from_raw(vio_user_ptr);                                                                                                                                                    
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                     
    |                                                                                                                                                                                           
    = note: call `drop(Box::from_raw(ptr))` if you intend to drop the `Box`

This PR fixes that by wrapping it with a drop()