From: Tomas Wenström Date: Tue, 5 Jan 2021 16:01:49 +0000 (+0100) Subject: Rect macro X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=0b5024d131d93cf4073479cd31506be826c1a4b2;p=kaka%2Frust-sdl-test.git Rect macro --- diff --git a/src/common.rs b/src/common.rs index 283640e..442b11c 100644 --- a/src/common.rs +++ b/src/common.rs @@ -37,6 +37,13 @@ impl AddAssign for Point2D { } } +#[macro_export] +macro_rules! rect { + ( $x:expr, $y:expr ) => { + Rect { x: $x, y: $y } + }; +} + #[derive(Default)] pub struct Rect { pub width: T,