我在Rust 1.6中重写了我的现有代码,我发现在源语言中通过typedef标记类型非常方便.例如,在我的纸牌游戏中,我将F#中的等级值定义为:
type Rank = uint8
types rust type-alias
rust ×1
type-alias ×1
types ×1