Skip to content
Snippets Groups Projects
Select Git revision
0 results

rust-openssl

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Stefan Bühler authored
    1. `X::from_ptr(p as *mut _)` is dangerous, as it not only casts
       `*const X::CType` to `*mut X::CType`, but any `*const U` to
       `*mut X::CType`.
       Add and use a extension trait to provide `from_const_ptr`.
    2. Often null pointers are returned as `Option<...>`; refactor the checks
       into `from_const_ptr_opt` for refs and `from_ptr_opt` for owned data.
    3. `assert!(!p.is_null())` is easy to mistype as `assert!(p.is_null());`.
       Use `X::from(_const)?ptr_opt(...).expect("...")` instead.
    b2caf477
    History
    Name Last commit Last update