Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel McCarney <[email protected]>
  • Loading branch information
jsha and cpu authored Nov 20, 2023
1 parent aeb7010 commit c2bfb04
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ and forth across the FFI boundary.

# Helper macros

We have an API guideline that we always check input pointers for NULL, and
return an error rather than dereferencing a NULL pointer. To help with that,
we have a number of helper macros that early-return if a pointer is NULL:

- try_ref_from_ptr!
- try_mut_from_ptr!
- try_box_from_ptr!
- try_clone_arc!
- try_callback!
- try_slice!
- try_take!

These are defined in src/lib.rs. The `Castable` trait determines which
We have an API guideline that we always check input pointers for `NULL`, and
return an error rather than dereferencing a `NULL` pointer. To help with that,
we have a number of helper macros that early-return if a pointer is `NULL`:

- `try_ref_from_ptr!`
- `try_mut_from_ptr!`
- `try_box_from_ptr!`
- `try_clone_arc!`
- `try_callback!`
- `try_slice!`
- `try_take!`

These are defined in [src/lib.rs](src/lib.rs). The `Castable` trait determines which
C pointers can be cast to which Rust pointer types. These macros rely
on that trait to ensure correct typing of conversions.

0 comments on commit c2bfb04

Please sign in to comment.