From 9096647083f70c430209e2ee5d0a535250342b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E9=A3=9ESunface?= Date: Tue, 22 Feb 2022 12:22:47 +0800 Subject: [PATCH] Update contents/basic/flow-control.md --- contents/basic/flow-control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/basic/flow-control.md b/contents/basic/flow-control.md index c3db6e56..9ee95b55 100644 --- a/contents/basic/flow-control.md +++ b/contents/basic/flow-control.md @@ -109,7 +109,7 @@ for item in &container { } ``` -【注:相比集合(collection),对于实现了 `copy` 特征的数组(array)而言, `for item in arr` 并不会把 `arr` 转移,因此循环之后仍然可以使用 `arr` 。】 +> 对于实现了 `copy` 特征的数组(例如 [i32; 10] )而言, `for item in arr` 并不会把 `arr` 转移,而是直接对其进行了拷贝,因此循环之后仍然可以使用 `arr` 。 如果想在循环中,**修改该元素**,可以使用 `mut` 关键字: