diff --git a/subjects/borrow/README.md b/subjects/borrow/README.md index e7e240b4..ba1f9e31 100644 --- a/subjects/borrow/README.md +++ b/subjects/borrow/README.md @@ -2,22 +2,16 @@ ### Instructions -Complete the signature and the body of the `str_len` **function** that receives a string or a string literal and returns its length without taking ownership of the value (i.e, borrowing the value). - -### Expected Function (The signature needs to be completed) +Create a **function** named `str_len`, you'll need to complete the function signature. Your function should accept a string or a string literal, and return its length without taking ownership of the value (i.e, borrowing the value). ```rust pub fn str_len(s: ) -> usize { } ``` -### Notions - -- [Primitive Type str](https://doc.rust-lang.org/std/primitive.str.html) - ### Usage -Here is a possible program to test your function : +Here is a possible program to test your function: ```rust use borrow::*; @@ -39,3 +33,7 @@ str_len("hello") = 5 str_len("camelCase") = 9 $ ``` + +### Notions + +- [Primitive Type str](https://doc.rust-lang.org/std/primitive.str.html)