This document contains notes about rust as we learn along.
enum is good for finite set of enumerations.
It does not work with infinite set (a.k.a open set).
enum Message {
Quit,
Move { x: i32, y: i32 }, // anonymous struct
Write(String),
ChangeColor(i32, i32, i32)
}Test util code (code shared by test) can be placed under sub-folder of tests. e.g. tests/common/mod.rs.
The sub-folder name doesn't matter.