diff --git a/src/user-defined-types/aliases.md b/src/user-defined-types/aliases.md index 4c998dd89f7..487590282c2 100644 --- a/src/user-defined-types/aliases.md +++ b/src/user-defined-types/aliases.md @@ -23,6 +23,10 @@ type PlayerInventory = RwLock>>>;
-C programmers will recognize this as similar to a `typedef`. +- A [newtype](tuple-structs.html) is often a better alternative since it creates + a distinct type. Prefer `struct InventoryCount(usize)` to + `type InventoryCount = usize`. + +- C programmers will recognize this as similar to a `typedef`.