From db584fd108ed0694b60f48a025c089129c420ffe Mon Sep 17 00:00:00 2001 From: Nihilism <114405451+Nihilism0@users.noreply.github.com> Date: Fri, 17 Mar 2023 09:24:01 +0800 Subject: [PATCH] Update array.md --- src/basic/compound-type/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/compound-type/array.md b/src/basic/compound-type/array.md index 06ac4c29..fd99d567 100644 --- a/src/basic/compound-type/array.md +++ b/src/basic/compound-type/array.md @@ -148,7 +148,7 @@ println!("{:#?}", array); **正确的写法**,应该调用`std::array::from_fn` ```rust -let array: [String; 8] = core::array::from_fn(|i| String::from("rust is good!")); +let array: [String; 8] = std::array::from_fn(|i| String::from("rust is good!")); println!("{:#?}", array); ```