Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #64 from pandoracore/compilererr-fix
Browse files Browse the repository at this point in the history
Adding docs to macros and fixeing rust lint warnings
  • Loading branch information
apoelstra committed Nov 29, 2019
2 parents 9201b0c + abca3ac commit 2b1dfe3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/util.rs
Expand Up @@ -17,10 +17,12 @@ macro_rules! circular_lshift32 (
($shift:expr, $w:expr) => (($w << $shift) | ($w >> (32 - $shift)))
);

/// Circular left-shift a 64-bit word
macro_rules! circular_lshift64 (
($shift:expr, $w:expr) => (($w << $shift) | ($w >> (64 - $shift)))
);

/// Adds hexadecimal formatting implementation of a trait `$imp` to a given type `$ty`
macro_rules! hex_fmt_impl(
($imp:ident, $ty:ident) => (
impl ::core::fmt::$imp for $ty {
Expand All @@ -36,6 +38,7 @@ macro_rules! hex_fmt_impl(
)
);

/// Adds `core::ops::Index` trait implementation to a given type `$ty`
macro_rules! index_impl(
($ty:ty) => (
impl ::core::ops::Index<usize> for $ty {
Expand Down Expand Up @@ -75,6 +78,7 @@ macro_rules! index_impl(
)
);

/// Adds slicing traits implementations to a given type `$ty`
macro_rules! borrow_slice_impl(
($ty:ty) => (
impl ::core::borrow::Borrow<[u8]> for $ty {
Expand Down

0 comments on commit 2b1dfe3

Please sign in to comment.