diff options
| author | Zerotask <Zerotask@users.noreply.github.com> | 2021-04-23 19:54:31 +0200 |
|---|---|---|
| committer | Zerotask <Zerotask@users.noreply.github.com> | 2021-04-23 19:54:31 +0200 |
| commit | 249ad44cc03974fd34708c23d9832b1729c6e844 (patch) | |
| tree | db25c5f51d76d10bc129dbcc8df2c56c75b13f2b /exercises/traits/README.md | |
| parent | 54804e344d84bb620447b7975a5b8ec4f9de2671 (diff) | |
docs(exercises): updated all exercises readme files
all exercises readme files now have a unified structure and a description
Diffstat (limited to 'exercises/traits/README.md')
| -rw-r--r-- | exercises/traits/README.md | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/exercises/traits/README.md b/exercises/traits/README.md index 8cd03ec..de67acd 100644 --- a/exercises/traits/README.md +++ b/exercises/traits/README.md @@ -1,4 +1,4 @@ -### Traits +# Traits A trait is a collection of methods. @@ -7,14 +7,13 @@ Data types can implement traits. To do so, the methods making up the trait are d In this way, traits are somewhat similar to Java interfaces and C++ abstract classes. Some additional common Rust traits include: - -+ `Clone` (the `clone` method), -+ `Display` (which allows formatted display via `{}`), and -+ `Debug` (which allows formatted display via `{:?}`). +- `Clone` (the `clone` method) +- `Display` (which allows formatted display via `{}`) +- `Debug` (which allows formatted display via `{:?}`) Because traits indicate shared behavior between data types, they are useful when writing generics. -#### Book Sections +## Further information - [Traits](https://doc.rust-lang.org/book/ch10-02-traits.html) |
