Skip to content

Commit c2eaa8f

Browse files
authored
Merge pull request #1638 from mo8it/fix-line-numbers
Avoid line numbers in hints
2 parents 6c51719 + 3cc9be0 commit c2eaa8f

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

info.toml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ name = "variables1"
2222
path = "exercises/variables/variables1.rs"
2323
mode = "compile"
2424
hint = """
25-
The declaration on line 8 is missing a keyword that is needed in Rust
26-
to create a new variable binding."""
25+
The declaration in the first line in the main function is missing a keyword
26+
that is needed in Rust to create a new variable binding."""
2727

2828
[[exercises]]
2929
name = "variables2"
@@ -32,7 +32,7 @@ mode = "compile"
3232
hint = """
3333
The compiler message is saying that Rust cannot infer the type that the
3434
variable binding `x` has with what is given here.
35-
What happens if you annotate line 7 with a type annotation?
35+
What happens if you annotate the first line in the main function with a type annotation?
3636
What if you give x a value?
3737
What if you do both?
3838
What type should x be, anyway?
@@ -44,8 +44,9 @@ path = "exercises/variables/variables3.rs"
4444
mode = "compile"
4545
hint = """
4646
Oops! In this exercise, we have a variable binding that we've created on
47-
line 7, and we're trying to use it on line 8, but we haven't given it a
48-
value. We can't print out something that isn't there; try giving x a value!
47+
in the first line in the main function, and we're trying to use it in the next line,
48+
but we haven't given it a value.
49+
We can't print out something that isn't there; try giving x a value!
4950
This is an error that can cause bugs that's very easy to make in any
5051
programming language -- thankfully the Rust compiler has caught this for us!"""
5152

@@ -123,8 +124,8 @@ name = "functions4"
123124
path = "exercises/functions/functions4.rs"
124125
mode = "compile"
125126
hint = """
126-
The error message points to line 17 and says it expects a type after the
127-
`->`. This is where the function's return type should be -- take a look at
127+
The error message points to the function `sale_price` and says it expects a type
128+
after the `->`. This is where the function's return type should be -- take a look at
128129
the `is_even` function for an example!
129130
130131
Also: Did you figure out that, technically, u32 would be the more fitting type
@@ -285,9 +286,10 @@ name = "move_semantics1"
285286
path = "exercises/move_semantics/move_semantics1.rs"
286287
mode = "compile"
287288
hint = """
288-
So you've got the "cannot borrow immutable local variable `vec1` as mutable" error on line 13,
289-
right? The fix for this is going to be adding one keyword, and the addition is NOT on line 13
290-
where the error is.
289+
So you've got the "cannot borrow immutable local variable `vec1` as mutable" error on the line
290+
where we push an element to the vector, right?
291+
The fix for this is going to be adding one keyword, and the addition is NOT on the line where
292+
we push to the vector (where the error is).
291293
292294
Also: Try accessing `vec0` after having called `fill_vec()`. See what happens!"""
293295

@@ -445,8 +447,9 @@ path = "exercises/strings/strings2.rs"
445447
mode = "compile"
446448
hint = """
447449
Yes, it would be really easy to fix this by just changing the value bound to `word` to be a
448-
string slice instead of a `String`, wouldn't it?? There is a way to add one character to line
449-
12, though, that will coerce the `String` into a string slice.
450+
string slice instead of a `String`, wouldn't it?? There is a way to add one character to the
451+
line with the function call `is_a_color_word`, though, that will coerce the `String` into a
452+
string slice.
450453
451454
Side note: If you're interested in learning about how this kind of reference conversion works, you can jump ahead in the book and read this part in the smart pointers chapter: https://doc.rust-lang.org/stable/book/ch15-02-deref.html#implicit-deref-coercions-with-functions-and-methods"""
452455

@@ -825,7 +828,6 @@ To handle that you need to add a special attribute to the test function.
825828
You can refer to the docs:
826829
https://doc.rust-lang.org/stable/book/ch11-01-writing-tests.html#checking-for-panics-with-should_panic"""
827830

828-
829831
# STANDARD LIBRARY TYPES
830832

831833
[[exercises]]

0 commit comments

Comments
 (0)