Skip to content

Commit

Permalink
chore: optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuang committed Oct 21, 2024
1 parent c2cd91a commit acdbbf5
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions src/datatype/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,28 +294,15 @@ pub unsafe fn free_rs_pointer_memory(
BasicDataType::WString => {
let _ = WideCString::from_raw(*(ptr as *mut *mut WideChar));
}
BasicDataType::U8 => {
let _ = Box::from_raw(ptr);
}
BasicDataType::I32 => {
let _ = Box::from_raw(ptr);
}
BasicDataType::I64 | BasicDataType::BigInt => {
let _ = Box::from_raw(ptr);
}
BasicDataType::U64 => {
let _ = Box::from_raw(ptr);
}
BasicDataType::Void => {
let _ = Box::from_raw(ptr);
}
BasicDataType::Float => {
let _ = Box::from_raw(ptr);
}
BasicDataType::Double => {
let _ = Box::from_raw(ptr);
}
BasicDataType::Boolean => {
BasicDataType::U8
| BasicDataType::I32
| BasicDataType::I64
| BasicDataType::BigInt
| BasicDataType::U64
| BasicDataType::Void
| BasicDataType::Float
| BasicDataType::Double
| BasicDataType::Boolean => {
let _ = Box::from_raw(ptr);
}
BasicDataType::External => {
Expand Down

0 comments on commit acdbbf5

Please sign in to comment.