mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 20:49:41 +00:00
fix: the code of advanced-traits ch-5 should be editable
This commit is contained in:
@ -258,7 +258,7 @@ This restriction is often called as the orphan rule, so named because the parent
|
|||||||
It’s possible to get around this restriction using the newtype pattern, which involves creating a new type in a tuple struct.
|
It’s possible to get around this restriction using the newtype pattern, which involves creating a new type in a tuple struct.
|
||||||
|
|
||||||
5. 🌟🌟
|
5. 🌟🌟
|
||||||
```rust
|
```rust,editable
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
// DEFINE a newtype `Pretty` here
|
// DEFINE a newtype `Pretty` here
|
||||||
|
@ -249,7 +249,7 @@ fn main() {
|
|||||||
|
|
||||||
|
|
||||||
5. 🌟🌟
|
5. 🌟🌟
|
||||||
```rust
|
```rust,editable
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
// 定义一个 newtype `Pretty`
|
// 定义一个 newtype `Pretty`
|
||||||
|
Reference in New Issue
Block a user