Using 0 as *const T or 0 as *mut T to represent a null pointer is error-prone and less readable. It can lead to confusion
and potential bugs, as it is not immediately clear that 0 is intended to represent a null pointer. Additionally, using 0 for
null pointers is not idiomatic Rust, and it can make the code harder to understand and maintain.
Use std::ptr::null or std::ptr::null_mut to represent null pointers. These functions are explicitly designed for this
purpose and make the intent of the code clear.
let ptr = 0 as *const i32; let mut_ptr = 0 as *mut i32;
let ptr = std::ptr::null::<i32>(); let mut_ptr = std::ptr::null_mut::<i32>();