diff --git a/src/user-defined-types/aliases.md b/src/user-defined-types/aliases.md index 4c998dd8..48759028 100644 --- a/src/user-defined-types/aliases.md +++ b/src/user-defined-types/aliases.md @@ -23,6 +23,10 @@ type PlayerInventory = RwLock<Vec<Arc<RefCell<Item>>>>; <details> -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`. </details>