From f6953d9e0d3133d3218af8c613251fd5dd4785e7 Mon Sep 17 00:00:00 2001 From: RogerJL Date: Wed, 5 Jul 2023 13:00:24 +0200 Subject: [PATCH] vecs1: add hint for to_vec() It actually only case 2 that fulfils the excersise instruction to use macro... --- info.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/info.toml b/info.toml index ac04fc7d..4d17097c 100644 --- a/info.toml +++ b/info.toml @@ -246,11 +246,13 @@ name = "vecs1" path = "exercises/vecs/vecs1.rs" mode = "test" hint = """ -In Rust, there are two ways to define a Vector. +In Rust, there are three ways to define a Vector. 1. One way is to use the `Vec::new()` function to create a new vector and fill it with the `push()` method. 2. The second way, which is simpler is to use the `vec![]` macro and define your elements inside the square brackets. +3. The third way, which is simplest in this case is to use conversion function + array.to_vec() Check this chapter: https://doc.rust-lang.org/stable/book/ch08-01-vectors.html of the Rust book to learn more. """