From 787dbfb4e03fdc6c6cfdb153e0e8fab2eb3ab2d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tomas=20Wenstr=C3=B6m?= Date: Sun, 7 Jul 2019 15:13:43 +0200 Subject: [PATCH] Use macro from common --- Cargo.lock | 2 ++ src/app.rs | 5 +---- src/common.rs | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61c7454..7de4beb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "autocfg" version = "0.1.2" diff --git a/src/app.rs b/src/app.rs index c8f8665..4972dfc 100644 --- a/src/app.rs +++ b/src/app.rs @@ -12,10 +12,7 @@ use boll::*; use common::Point2D; use sprites::SpriteManager; use NS_PER_FRAME; - -macro_rules! point { // because I don't know how to import it from common.rs ... - ( $x:expr, $y:expr ) => { Point2D { x:$x, y:$y } }; -} +use point; // defined in common, but loaded from main... pub type Nanoseconds = u64; diff --git a/src/common.rs b/src/common.rs index f3b3373..6f000d8 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,5 +1,6 @@ use std::ops::{Add, AddAssign}; +#[macro_export] macro_rules! point { ( $x:expr, $y:expr ) => { Point2D { x:$x, y:$y } }; } -- 2.11.0