Favour $reverse instead of $reversed

Currently we have two things that are the same but use different
identifiers, use `$reverse` instead of `$reversed`.
This commit is contained in:
Tobin C. Harding 2023-01-20 10:57:29 +11:00
parent ca902e65f8
commit 3344cf6be2
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 6 additions and 6 deletions

View File

@ -53,7 +53,7 @@ pub(crate) use arr_newtype_fmt_impl;
/// Arguments: /// Arguments:
/// ///
/// * `$bits` - number of bits this hash type has /// * `$bits` - number of bits this hash type has
/// * `$reversed` - `bool` - `true` if the hash type should be displayed backwards, `false` /// * `$reverse` - `bool` - `true` if the hash type should be displayed backwards, `false`
/// otherwise. /// otherwise.
/// * `$gen: $gent` - generic type(s) and trait bound(s) /// * `$gen: $gent` - generic type(s) and trait bound(s)
/// ///
@ -67,7 +67,7 @@ pub(crate) use arr_newtype_fmt_impl;
/// `internal_new` is required so that types with more than one field are constructible. /// `internal_new` is required so that types with more than one field are constructible.
/// `internal_engine` is required to initialize the engine for given hash type. /// `internal_engine` is required to initialize the engine for given hash type.
macro_rules! hash_trait_impls { macro_rules! hash_trait_impls {
($bits:expr, $reversed:expr $(, $gen:ident: $gent:ident)*) => { ($bits:expr, $reverse:expr $(, $gen:ident: $gent:ident)*) => {
impl<$($gen: $gent),*> Hash<$($gen),*> { impl<$($gen: $gent),*> Hash<$($gen),*> {
/// Displays hex forwards, regardless of how this type would display it naturally. /// Displays hex forwards, regardless of how this type would display it naturally.
/// ///
@ -111,7 +111,7 @@ macro_rules! hash_trait_impls {
type Inner = [u8; $bits / 8]; type Inner = [u8; $bits / 8];
const LEN: usize = $bits / 8; const LEN: usize = $bits / 8;
const DISPLAY_BACKWARD: bool = $reversed; const DISPLAY_BACKWARD: bool = $reverse;
fn engine() -> Self::Engine { fn engine() -> Self::Engine {
Self::internal_engine() Self::internal_engine()
@ -159,14 +159,14 @@ pub(crate) use hash_trait_impls;
/// Arguments: /// Arguments:
/// ///
/// * `$bits` - the number of bits of the hash type /// * `$bits` - the number of bits of the hash type
/// * `$reversed` - `true` if the hash should be displayed backwards, `false` otherwise /// * `$reverse` - `true` if the hash should be displayed backwards, `false` otherwise
/// * `$doc` - doc string to put on the type /// * `$doc` - doc string to put on the type
/// * `$schemars` - a literal that goes into `schema_with`. /// * `$schemars` - a literal that goes into `schema_with`.
/// ///
/// The `from_engine` free-standing function is still required with this macro. See the doc of /// The `from_engine` free-standing function is still required with this macro. See the doc of
/// [`hash_trait_impls`]. /// [`hash_trait_impls`].
macro_rules! hash_type { macro_rules! hash_type {
($bits:expr, $reversed:expr, $doc:literal, $schemars:literal) => { ($bits:expr, $reverse:expr, $doc:literal, $schemars:literal) => {
#[doc = $doc] #[doc = $doc]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "schemars", derive(crate::schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(crate::schemars::JsonSchema))]
@ -186,7 +186,7 @@ macro_rules! hash_type {
} }
} }
crate::internal_macros::hash_trait_impls!($bits, $reversed); crate::internal_macros::hash_trait_impls!($bits, $reverse);
} }
} }
pub(crate) use hash_type; pub(crate) use hash_type;