Skip to content

Commit

Permalink
Merge pull request #51 from ewasm/reorder-macro
Browse files Browse the repository at this point in the history
Unify argument ordering for auto-impl macros
  • Loading branch information
axic authored May 27, 2019
2 parents 9cc0d51 + 9f1ea47 commit 664a8f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ macro_rules! from_primitive_ref_impl {
}

macro_rules! from_type_for_primitive_impl {
($f:ident, $to:ident, $size:expr) => {
($f:ident, $size:expr, $to:ident) => {
impl From<$f> for [$to; $size] {
fn from(a: $f) -> Self {
a.bytes
Expand All @@ -83,10 +83,10 @@ from_primitive_ref_impl!(u8, 32, Uint256);
from_primitive_ref_impl!(u8, 20, Bytes20);
from_primitive_ref_impl!(u8, 32, Bytes32);

from_type_for_primitive_impl!(Uint128, u8, 16);
from_type_for_primitive_impl!(Uint256, u8, 32);
from_type_for_primitive_impl!(Bytes20, u8, 20);
from_type_for_primitive_impl!(Bytes32, u8, 32);
from_type_for_primitive_impl!(Uint128, 16, u8);
from_type_for_primitive_impl!(Uint256, 32, u8);
from_type_for_primitive_impl!(Bytes20, 20, u8);
from_type_for_primitive_impl!(Bytes32, 32, u8);

#[cfg(test)]
mod tests {
Expand Down

0 comments on commit 664a8f3

Please sign in to comment.