Browse Source

docs(borrow): correct grammar

pull/1092/head
davhojt 2 years ago committed by Dav Hojt
parent
commit
d99e5ef650
  1. 14
      subjects/borrow/README.md

14
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)

Loading…
Cancel
Save