Skip to content

Commit

Permalink
Update README.md (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunjhongwu authored Jan 1, 2024
1 parent 5d860e1 commit 82458f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ println!("{}", timestamp); // Timestamp(1701620628123456789)
- **Derive trait `StrongType`:** Create a named strong type.
- The macro automatically implement common traits like `Clone`, `Debug`, `Default`, `PartialEq`, `PartialOrd`, `Send`, and `Sync`. It also implements `Display` by default, unless overridden by the custom_display attribute.
- Conditionally, based on the underlying data type, traits like `Copy`, `Eq`, `Ord`, `Hash` may also be implemented. For primitive data types like `i32` or `bool`, these additional traits will be automatically included.
- Numeric types (integer and floating-point) additionally implement methods like `min()`, `max()`, and, for floating-point types, `nan()`.
- Numeric types, both integer and floating-point, also implement constants `MIN`, `MAX`. Additionally, for floating-point types, the method `nan()` is implemented.

- **Attributes:** Adding the following attributes to `#[strong_type(...)]` allows for additional features:
- `auto_operators`: Automatically implements relevant arithmetic (for numeric types) or logical (for boolean types) operators.
Expand Down

0 comments on commit 82458f3

Please sign in to comment.