From d232f3823e63e56ec29501fd287c82a0c8e975d6 Mon Sep 17 00:00:00 2001 From: nprimo Date: Wed, 3 Jul 2024 12:37:33 +0100 Subject: [PATCH] docs(borrow_me_the_reference): correct example code --- subjects/borrow_me_the_reference/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/subjects/borrow_me_the_reference/README.md b/subjects/borrow_me_the_reference/README.md index 4cbc91444..8c48baf11 100644 --- a/subjects/borrow_me_the_reference/README.md +++ b/subjects/borrow_me_the_reference/README.md @@ -13,6 +13,7 @@ Create the following functions: - `do_operations`: which borrows a Vector of string literals representing simple addition and subtraction equations. The function should replace the operation with the result. ### Expected Functions + ```rust pub fn delete_and_backspace(s: &mut String) { } @@ -30,7 +31,12 @@ use borrow_me_the_reference::{delete_and_backspace, do_operations}; fn main() { let mut a = String::from("bpp--o+er+++sskroi-++lcw"); - let mut b: Vec = vec!["2+2", "3+2", "10-3", "5+5"]; + let mut b: Vec = vec![ + "2+2".to_string(), + "3+2".to_string(), + "10-3".to_string(), + "5+5".to_string(), + ]; delete_and_backspace(&mut a); do_operations(&mut b);