From 90166696f482771fe9ec27e779c5cbdb3e23aad6 Mon Sep 17 00:00:00 2001 From: Zheng Ping Date: Mon, 5 Jun 2017 15:58:37 +0800 Subject: [PATCH] Update ch17-03-oo-design-patterns.md --- src/ch17-03-oo-design-patterns.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch17-03-oo-design-patterns.md b/src/ch17-03-oo-design-patterns.md index 221e588..594b301 100644 --- a/src/ch17-03-oo-design-patterns.md +++ b/src/ch17-03-oo-design-patterns.md @@ -41,9 +41,9 @@ fn main() { 注意我们和crate联系的唯一类型是`Post`类型. 一个博客的状态可以是草稿、等待审核和发布中的一种, 这些状态在`Post`类型内部被管理. 状态通过我们调用`Post`实例上的方法被改变, 我们不必直接去改变状态. 这也意味着我们不会用状态来犯错误, 比如在发布之前忘了请求审核. -### Defining `Post` and Creating a New Instance in the Draft State +### 定义`Post`类型并创建一个草稿状态的新实例 -Let's get started on the implementation of the library! We know we want to have +让我们开始来实现这个库吧! We know we want to have a public `Post` struct that holds some content, so let's start with the definition of the struct and an associated public `new` function to create an instance of `Post` as shown in Listing 17-12. We're also going to have a