summaryrefslogtreecommitdiff
path: root/rustlings-macros/info.toml
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-05-21 02:43:18 +0200
committermo8it <mo8it@proton.me>2024-05-21 02:43:18 +0200
commitd0b843d6c4a99636d3dc6caf3ceebea14cb3b07d (patch)
tree2021b096bdd07d37abbf71ed1df3b0b58753f67a /rustlings-macros/info.toml
parent0f4c42d54ea7322a4ee0ae7036c058c3061e80e9 (diff)
Add solutions to functions
Diffstat (limited to 'rustlings-macros/info.toml')
-rw-r--r--rustlings-macros/info.toml22
1 files changed, 11 insertions, 11 deletions
diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml
index be3b262..495e9c3 100644
--- a/rustlings-macros/info.toml
+++ b/rustlings-macros/info.toml
@@ -142,7 +142,7 @@ test = false
hint = """
This `main` function is calling a function that it expects to exist, but the
function doesn't exist. It expects this function to have the name `call_me`.
-It expects this function to not take any arguments and not return a value.
+It also expects this function to not take any arguments and not return a value.
Sounds a lot like `main`, doesn't it?"""
[[exercises]]
@@ -159,7 +159,7 @@ dir = "02_functions"
test = false
hint = """
This time, the function *declaration* is okay, but there's something wrong
-with the place where we're calling the function."""
+with the place where we are calling the function."""
[[exercises]]
name = "functions4"
@@ -167,8 +167,8 @@ dir = "02_functions"
test = false
hint = """
The error message points to the function `sale_price` and says it expects a type
-after the `->`. This is where the function's return type should be -- take a
-look at the `is_even` function for an example!"""
+after `->`. This is where the function's return type should be.
+Take a look at the `is_even` function for an example!"""
[[exercises]]
name = "functions5"
@@ -177,15 +177,15 @@ test = false
hint = """
This is a really common error that can be fixed by removing one character.
It happens because Rust distinguishes between expressions and statements:
-expressions return a value based on their operand(s), and statements simply
-return a `()` type which behaves just like `void` in C/C++ language.
+Expressions return a value based on their operand(s), and statements simply
+return a `()` type which behaves just like `void` in C/C++.
-We want to return a value of `i32` type from the `square` function, but it is
-returning a `()` type...
+We want to return a value with the type `i32` from the `square` function, but
+it is returning the type `()`.
-They are not the same. There are two solutions:
-1. Add a `return` ahead of `num * num;`
-2. remove `;`, make it to be `num * num`"""
+There are two solutions:
+1. Add the `return` keyword before `num * num;`
+2. Remove the semicolon `;` after `num * num`"""
# IF