1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-23 07:06:19 +02:00

Add notes about traits.

This commit is contained in:
Andrew Walbran 2023-03-13 16:16:02 +00:00
parent bc21369dcb
commit d6027f5080

View File

@ -1,5 +1,13 @@
# More traits
We derived the `Debug` trait. It would be useful to implement a few more traits too.
```rust,editable,compile_fail
{{#include ../examples/src/pl011_minimal.rs:Traits}}
```
<details>
* Implementing `Write` lets us use the `write!` and `writeln!` macros with our `Uart` type.
</details>