reluxscript 0.1.4

Write AST transformations once. Compile to Babel, SWC, and beyond.
Documentation
/**
 * Module B - Higher level utilities that depend on Module A
 */

pub use "./dist/module_a" { Point, distance_squared, origin };

#[derive(Default)]
pub struct Rectangle {
    pub top_left: Point,
    pub bottom_right: Point,
}

pub fn area(r: &Rectangle) -> i32 {
    let width = r.bottom_right.x - r.top_left.x;
    let height = r.bottom_right.y - r.top_left.y;
    width * height
}

pub fn is_at_origin(r: &Rectangle) -> bool {
    distance_squared(&r.top_left) == 0
}