From 209019a508616fd28a2edc86c8c24e8d45ddd32e Mon Sep 17 00:00:00 2001 From: Zheng Ping Date: Wed, 7 Jun 2017 18:08:13 +0800 Subject: [PATCH] Update ch17-03-oo-design-patterns.md --- src/ch17-03-oo-design-patterns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch17-03-oo-design-patterns.md b/src/ch17-03-oo-design-patterns.md index 030b79d..3893248 100644 --- a/src/ch17-03-oo-design-patterns.md +++ b/src/ch17-03-oo-design-patterns.md @@ -73,7 +73,7 @@ impl State for Draft {} 当我们创建一个新的`Post`实例时, 我们把它的`state`字段设为一个`Some`类型的值, 该值持有指向一个新的`Draft`结构实例的`Box`. 这就确保无论何时我们创建一个`Post`类型的新实例时, 它总是处于草稿状态. 因为`Post`的`state`字段是私有的, 除了调用`new`无法创建一个处于其它状态的`Post`! -### Storing the Text of the Post Content +### 存放Post的文本内容 In the `Post::new` function, we set the `content` field to a new, empty `String`. In Listing 17-11, we showed that we want to be able to call a method