Browse Source

docs(borrow_me_the_reference): correct example code

pull/2637/head
nprimo 3 months ago committed by Niccolò Primo
parent
commit
d232f3823e
  1. 8
      subjects/borrow_me_the_reference/README.md

8
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<String> = vec!["2+2", "3+2", "10-3", "5+5"];
let mut b: Vec<String> = 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);

Loading…
Cancel
Save