Merge pull request #414 from Spartan09/patch-1

Update Q6 array.md
This commit is contained in:
Sunface
2025-04-25 12:07:28 +08:00
committed by GitHub

View File

@ -88,7 +88,7 @@ fn main() {
fn main() {
let names = [String::from("Sunfei"), "Sunface".to_string()];
// `Get` returns an Option<T>, 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
> 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