From 1c17d0f215dfa705e11eb1a0d8e1205bce794388 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 3 Nov 2022 14:36:17 +1100 Subject: [PATCH] Improve docs on impl_array_newtype Improve the rustdocs on the `impl_array_newtype` macro by adding full stops and re-writing the outer comment. --- secp256k1-sys/src/macros.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/secp256k1-sys/src/macros.rs b/secp256k1-sys/src/macros.rs index 3ae70af..e3850f0 100644 --- a/secp256k1-sys/src/macros.rs +++ b/secp256k1-sys/src/macros.rs @@ -13,32 +13,32 @@ // If not, see . // -// This is a macro that routinely comes in handy +/// Implement methods and traits for types that contain an inner array. #[macro_export] macro_rules! impl_array_newtype { ($thing:ident, $ty:ty, $len:expr) => { impl Copy for $thing {} impl $thing { - /// Converts the object to a raw pointer for FFI interfacing + /// Converts the object to a raw pointer for FFI interfacing. #[inline] pub fn as_ptr(&self) -> *const $ty { let &$thing(ref dat) = self; dat.as_ptr() } - /// Converts the object to a mutable raw pointer for FFI interfacing + /// Converts the object to a mutable raw pointer for FFI interfacing. #[inline] pub fn as_mut_ptr(&mut self) -> *mut $ty { let &mut $thing(ref mut dat) = self; dat.as_mut_ptr() } - /// Returns the length of the object as an array + /// Returns the length of the object as an array. #[inline] pub fn len(&self) -> usize { $len } - /// Returns whether the object as an array is empty + /// Returns whether the object as an array is empty. #[inline] pub fn is_empty(&self) -> bool { false } }