doc: Fix preallocated memory grammar

The grammar on structs that implement `Context` using preallocated
memory is slightly incorrect. Attempt to improve the grammar.
This commit is contained in:
Tobin C. Harding 2022-11-10 11:38:45 +11:00
parent 5a546945ad
commit 5a7cedef00
1 changed files with 4 additions and 4 deletions

View File

@ -76,19 +76,19 @@ pub trait Signing: Context {}
/// Marker trait for indicating that an instance of `Secp256k1` can be used for verification. /// Marker trait for indicating that an instance of `Secp256k1` can be used for verification.
pub trait Verification: Context {} pub trait Verification: Context {}
/// Represents the set of capabilities needed for signing with a user preallocated memory. /// Represents the set of capabilities needed for signing (preallocated memory).
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SignOnlyPreallocated<'buf> { pub struct SignOnlyPreallocated<'buf> {
phantom: PhantomData<&'buf ()>, phantom: PhantomData<&'buf ()>,
} }
/// Represents the set of capabilities needed for verification with a user preallocated memory. /// Represents the set of capabilities needed for verification (preallocated memory).
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct VerifyOnlyPreallocated<'buf> { pub struct VerifyOnlyPreallocated<'buf> {
phantom: PhantomData<&'buf ()>, phantom: PhantomData<&'buf ()>,
} }
/// Represents the set of all capabilities with a user preallocated memory. /// Represents the set of all capabilities (preallocated memory).
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct AllPreallocated<'buf> { pub struct AllPreallocated<'buf> {
phantom: PhantomData<&'buf ()>, phantom: PhantomData<&'buf ()>,
@ -301,7 +301,7 @@ unsafe impl<'buf> Context for AllPreallocated<'buf> {
} }
impl<'buf, C: Context + 'buf> Secp256k1<C> { impl<'buf, C: Context + 'buf> Secp256k1<C> {
/// Lets you create a context with preallocated buffer in a generic manner(sign/verify/all) /// Lets you create a context with a preallocated buffer in a generic manner(sign/verify/all).
pub fn preallocated_gen_new(buf: &'buf mut [AlignedType]) -> Result<Secp256k1<C>, Error> { pub fn preallocated_gen_new(buf: &'buf mut [AlignedType]) -> Result<Secp256k1<C>, Error> {
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
ffi::types::sanity_checks_for_wasm(); ffi::types::sanity_checks_for_wasm();