From ff6c841dd5d86868ef69a562a528629113a414d2 Mon Sep 17 00:00:00 2001 From: Ayushman <31277910+Spartan09@users.noreply.github.com> Date: Sun, 2 Jul 2023 23:10:16 +0530 Subject: [PATCH] Update Q6 array.md changed comment suggesting arr.get() return Option to Option<&T> --- en/src/compound-types/array.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/src/compound-types/array.md b/en/src/compound-types/array.md index 281c141..9833ec5 100644 --- a/en/src/compound-types/array.md +++ b/en/src/compound-types/array.md @@ -88,7 +88,7 @@ fn main() { fn main() { let names = [String::from("Sunfei"), "Sunface".to_string()]; - // `Get` returns an Option, it's safe to use + // `Get` returns an Option<&T>, it's safe to use let name0 = names.get(0).unwrap(); // But indexing is not safe @@ -99,4 +99,4 @@ fn main() { ``` -> You can find the solutions [here](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/array.md)(under the solutions path), but only use it when you need it \ No newline at end of file +> You can find the solutions [here](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/array.md)(under the solutions path), but only use it when you need it