Dolda2000 GitWeb
/
kaka
/
rust-sdl-test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98995f2
)
Rect macro
author
Tomas Wenström
<tomas.wenstrom@gmail.com>
Tue, 5 Jan 2021 16:01:49 +0000
(17:01 +0100)
committer
Tomas Wenström
<tomas.wenstrom@gmail.com>
Tue, 5 Jan 2021 16:01:49 +0000
(17:01 +0100)
src/common.rs
patch
|
blob
|
blame
|
history
diff --git
a/src/common.rs
b/src/common.rs
index
283640e
..
442b11c
100644
(file)
--- a/
src/common.rs
+++ b/
src/common.rs
@@
-37,6
+37,13
@@
impl<T: AddAssign> AddAssign for Point2D<T> {
}
}
+#[macro_export]
+macro_rules! rect {
+ ( $x:expr, $y:expr ) => {
+ Rect { x: $x, y: $y }
+ };
+}
+
#[derive(Default)]
pub struct Rect<T> {
pub width: T,