From e49cba737981754811561549e6cb2b15ba4f0723 Mon Sep 17 00:00:00 2001 From: chenxuuu Date: Mon, 10 Jan 2022 13:32:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BE=8B=E5=AD=90=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E5=90=88=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/contents/basic/compound-type/struct.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/contents/basic/compound-type/struct.md b/book/contents/basic/compound-type/struct.md index 56d770de..d55d76b9 100644 --- a/book/contents/basic/compound-type/struct.md +++ b/book/contents/basic/compound-type/struct.md @@ -127,7 +127,7 @@ fn build_user(email: String, username: String) -> User { println!("{}", user1.active); // 下面这行会报错 - //println!("{}", user1); + //println!("{}", user1.username); ``` ## 结构体的内存排列 @@ -246,4 +246,4 @@ help: consider introducing a named lifetime parameter ``` -未来在[生命周期](../../advance/lifetime/basic.md)中会讲到如何修复这个问题以便在结构体中存储引用,不过在那之前,我们会避免在结构体中使用引用类型。 \ No newline at end of file +未来在[生命周期](../../advance/lifetime/basic.md)中会讲到如何修复这个问题以便在结构体中存储引用,不过在那之前,我们会避免在结构体中使用引用类型。