Skip to content

Commit 7c08abb

Browse files
committed
Document the Zero trait
1 parent f107718 commit 7c08abb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/rust.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,8 @@ Supported traits for `deriving` are:
17171717
* `Clone` and `DeepClone`, to perform (deep) copies.
17181718
* `IterBytes`, to iterate over the bytes in a data type.
17191719
* `Rand`, to create a random instance of a data type.
1720-
* `Zero`, to create an zero (or empty) instance of a data type.
1720+
* `Default`, to create an empty instance of a data type.
1721+
* `Zero`, to create an zero instance of a numeric data type.
17211722
* `ToStr`, to convert to a string. For a type with this instance,
17221723
`obj.to_str()` has similar output as `fmt!("%?", obj)`, but it differs in that
17231724
each constituent field of the type must also implement `ToStr` and will have

doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2249,7 +2249,7 @@ enum ABC { A, B, C }
22492249

22502250
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
22512251
`TotalOrd`, `Encodable` `Decodable`, `Clone`, `DeepClone`,
2252-
`IterBytes`, `Rand`, `Zero`, and `ToStr`.
2252+
`IterBytes`, `Rand`, `Default`, `Zero`, and `ToStr`.
22532253

22542254
# Crates and the module system
22552255

0 commit comments

Comments
 (0)