From c4c7fabfd042d7f29f45421b0de425c169ed3336 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 6 Feb 2021 23:18:11 +0000 Subject: [PATCH] reformating and notions --- subjects/ownership/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/subjects/ownership/README.md b/subjects/ownership/README.md index 6a5eda1f..ec14faf9 100644 --- a/subjects/ownership/README.md +++ b/subjects/ownership/README.md @@ -2,10 +2,14 @@ ### Instruction -- Create a function that takes ownership of a string and returns the first sub-word in it +- Create a **function** that takes ownership of a string and returns the first sub-word in it - It should work for `camelCase` as well as `snake_case` +### Notions + +- [ownership](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html) + ### Expected Function ```rust @@ -15,9 +19,11 @@ pub fn first_subword(mut s: String) -> String { ### Usage -Here is a program to test your function +Here is a program to test your function: ```rust +use ownership::first_subword; + fn main() { let s1 = String::from("helloWorld"); let s2 = String::from("snake_case"); @@ -31,7 +37,7 @@ fn main() { } ``` -And its output +And its output: ```console student@ubuntu:~/[[ROOT]]/test$ cargo run