From: Tomas Wenström Date: Sun, 7 Jul 2019 13:13:43 +0000 (+0200) Subject: Use macro from common X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=787dbfb4e03fdc6c6cfdb153e0e8fab2eb3ab2d1;p=kaka%2Frust-sdl-test.git Use macro from common --- 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 } }; }