From c2bfb04f4bafa75352eae28710d6801a3b2cd19e Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Mon, 20 Nov 2023 09:38:24 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Daniel McCarney --- CONTRIBUTING.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6368cce7..733a3607 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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.