Browse Source

docs: implement Miguel's feedback

pull/1092/head
davhojt 2 years ago committed by Dav Hojt
parent
commit
5f935e29a8
  1. 1
      subjects/arrange_it/README.md
  2. 1
      subjects/borrow/README.md
  3. 1
      subjects/borrow_me_the_reference/README.md
  4. 1
      subjects/copy/README.md
  5. 1
      subjects/doubtful/README.md
  6. 1
      subjects/name_initials/README.md
  7. 1
      subjects/ownership/README.md
  8. 3
      subjects/string_literals/README.md
  9. 8
      subjects/tic_tac_toe/README.md
  10. 1
      subjects/to_url/README.md

1
subjects/arrange_it/README.md

@ -4,6 +4,7 @@
Create a **function** named `arrange_phrase`, that takes a string literal, _sorts_ the words and returns it. Each word will contain a number that indicates the position of that word.
### Expected Functions
```rust
pub fn arrange_phrase(phrase: &str) -> String {
}

1
subjects/borrow/README.md

@ -4,6 +4,7 @@
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).
### Expected functions
```rust
pub fn str_len(s: ) -> usize {
}

1
subjects/borrow_me_the_reference/README.md

@ -11,7 +11,6 @@ Create the following functions:
- `is_correct`: which borrows a Vector of string literals representing simple addition and subtraction equations. The function should replace the correct equations with `✔`, and the wrong ones with `✘`. It should return a `usize` with the percentage of correct equations.
### Expected Functions
```rust
pub fn delete_and_backspace(s: &mut String) {
}

1
subjects/copy/README.md

@ -15,6 +15,7 @@ Create the following **functions**. The objective is to know how ownership works
- with the `original` value.
- and the `natural logarithm` of each `absolute` value.
### Expected functions
```rust
pub fn nbr_function(c: i32) -> (i32, f64, f64) {
}

1
subjects/doubtful/README.md

@ -4,6 +4,7 @@
Create a function named `doubtful` which appends a question mark to every string passed to it. It must not return a value.
### Expected functions
```rust
pub fn doubtful(s: /*give the correct type*/ ) {
}

1
subjects/name_initials/README.md

@ -4,6 +4,7 @@
Create a **function** named `initials`. This function will receive a vector of string literals with names, and return a vector of Strings with the initials of each name.
### Expected Functions
```rust
pub fn initials(names: Vec<&str>) -> Vec<String> {
}

1
subjects/ownership/README.md

@ -4,6 +4,7 @@
Create a **function** named `first_subword`, that takes ownership of a string and returns the first sub-word in it. It should work for `camelCase`, `PascalCase`, and `snake_case`.
### Expected functions
```rust
pub fn first_subword(mut s: String) -> String {
}

3
subjects/string_literals/README.md

@ -8,8 +8,9 @@ Create the following functions:
- `is_ascii`: that returns `true` if all characters are within the ASCII range.
- `contains`: that returns `true` if the string contains the given pattern.
- `split_at`: that divides a string in two returning a tuple.
- `find`: that returns the index if the first character of a given string that matches the pattern.
- `find`: that returns the index of the first character of a given string that matches the pattern.
### Expected functions
```rust
pub fn is_empty(v: &str) -> bool {
}

8
subjects/tic_tac_toe/README.md

@ -6,14 +6,14 @@ You must create some functions for a tic-tac-toe checker.
Create a function named `tic_tac_toe`, which receives a tic-tac-toe table. It should return the appropriate string: `"player O won"`, `"player X won"` or `"Tie"`.
```rust
pub fn tic_tac_toe(table: Vec<Vec<&str>>) -> String {
}
```
Also create the following functions, which each accept a player and a table. These functions should return `true` if the player has completed one of the diagonals, rows or columns:
### Expected functions
```rust
pub fn tic_tac_toe(table: Vec<Vec<&str>>) -> String {
}
pub fn diagonals(player: &str, table: &Vec<Vec<&str>>) -> bool {
}

1
subjects/to_url/README.md

@ -4,6 +4,7 @@
Create a **function** named `to_url` which takes a string and substitutes every white-space with `"%20"`.
### Expected functions
```rust
pub fn to_url(s: &str) -> String {
}

Loading…
Cancel
Save