From 50e5fe0e8039db231b1bfc971753fc183ba927aa Mon Sep 17 00:00:00 2001 From: lee Date: Tue, 16 Feb 2021 18:22:25 +0000 Subject: [PATCH] adding: instructions to memory management subjects --- subjects/arrange_it/README.md | 2 +- subjects/name_initials/README.md | 8 ++++---- subjects/string_literals/README.md | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/subjects/arrange_it/README.md b/subjects/arrange_it/README.md index 062d8894..cf13f373 100644 --- a/subjects/arrange_it/README.md +++ b/subjects/arrange_it/README.md @@ -5,7 +5,7 @@ Create a **function** called `arrange_phrase` that takes a string literal as a phrase and returns it organized Each word will have a number that indicates the position of that word. -> This exercise will test the **heap allocation** of your function! +> This exercise will test how many times the **heap is going to be allocated**!\ > So try your best to allocate the minimum data on the heap! ### Expected Function diff --git a/subjects/name_initials/README.md b/subjects/name_initials/README.md index f4a39451..df573efe 100644 --- a/subjects/name_initials/README.md +++ b/subjects/name_initials/README.md @@ -5,7 +5,7 @@ Create a **function** called `initials`, this function will receive a vector of string literals with names and return a vector of Strings with the initials of each name. -> This exercise will test the **heap allocation** of your function! +> This exercise will test how many times the **heap is going to be allocated**!\ > So try your best to allocate the minimum data on the heap! ### Notions @@ -15,7 +15,7 @@ with names and return a vector of Strings with the initials of each name. ### Expected Function ```rust -pub fn initials(names: &mut Vec<&str>) -> Vec { +pub fn initials(names: Vec<&str>) -> Vec { } ``` @@ -27,8 +27,8 @@ Here is a program to test your function: use name_initials::initials; fn main() { - let mut names = vec!["Harry Potter", "Someone Else", "J. L.", "Barack Obama"] - println!("{:?}", initials(&mut names)); + let names = vec!["Harry Potter", "Someone Else", "J. L.", "Barack Obama"] + println!("{:?}", initials(names)); } ``` diff --git a/subjects/string_literals/README.md b/subjects/string_literals/README.md index f159e688..9215285d 100644 --- a/subjects/string_literals/README.md +++ b/subjects/string_literals/README.md @@ -10,8 +10,8 @@ Create the following functions: - `split_at`, that divides a string in two returning a tuple - `find', that returns the index if the first character of a given string that matches the pattern -> This exercise will test the **heap allocation** of your function! -> So try your best to allocate the minimum data on the heap! (hit: &str) +> This exercise will test how many times the **heap is going to be allocated**!\ +> So try your best to allocate the minimum data on the heap! ### Notions