reluxscript 0.1.4

Write AST transformations once. Compile to Babel, SWC, and beyond.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
 * Module A - Base utilities
 */

#[derive(Default)]
pub struct Point {
    pub x: i32,
    pub y: i32,
}

pub fn distance_squared(p: &Point) -> i32 {
    p.x * p.x + p.y * p.y
}

pub fn origin() -> Point {
    Point { x: 0, y: 0 }
}