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

Commit

Permalink
Adding docs to exported macros
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Nov 29, 2019
1 parent bf05606 commit abca3ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/util.rs
Original file line number Diff line number Diff line change
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 abca3ac

Please sign in to comment.