2019-12-30 17:51:06 +00:00
|
|
|
mod geometry;
|
2019-12-31 01:32:23 +00:00
|
|
|
mod stream_algos;
|
2019-12-30 17:51:06 +00:00
|
|
|
|
2019-12-31 02:10:55 +00:00
|
|
|
use geometry::{Point, Rectangle};
|
|
|
|
|
2019-12-30 17:51:06 +00:00
|
|
|
fn main() {
|
|
|
|
let p = geometry::Point::new(2, 3);
|
|
|
|
let y = p;
|
|
|
|
dbg!(p + y);
|
2019-12-31 02:10:55 +00:00
|
|
|
|
|
|
|
let various = vec![
|
|
|
|
Rectangle::from_corner_width_height(Point::new(20, 110), 10, 10),
|
|
|
|
Rectangle::from_corner_width_height(Point::new(25, 115), 10, 10),
|
|
|
|
Rectangle::from_corner_width_height(Point::new(10, 100), 1000, 1000),
|
|
|
|
Rectangle::from_corner_width_height(Point::new(2010, 2100), 1, 1),
|
|
|
|
];
|
|
|
|
|
2020-01-01 17:01:01 +00:00
|
|
|
// Clone here so that we can continue to use the original if needed later.
|
2019-12-31 02:10:55 +00:00
|
|
|
let r: Vec<_> = stream_algos::translate(various.clone().drain(0..), Point::new(1, 2)).collect();
|
|
|
|
dbg!(&r);
|
2019-12-30 17:51:06 +00:00
|
|
|
}
|