@@ -16,16 +16,14 @@ get started, here are some notes about how Rustlings operates:
16
16
3. If you're stuck on an exercise, enter `h` to show a hint.
17
17
4. If an exercise doesn't make sense to you, feel free to open an issue on GitHub!
18
18
(https://github.com/rust-lang/rustlings). We look at every issue, and sometimes,
19
- other learners do too so you can help each other out!
20
- """
19
+ other learners do too so you can help each other out!"""
21
20
22
21
final_message = """ We hope you enjoyed learning about the various aspects of Rust!
23
22
If you noticed any issues, don't hesitate to report them on Github.
24
23
You can also contribute your own exercises to help the greater community!
25
24
26
25
Before reporting an issue or contributing, please read our guidelines:
27
- https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md
28
- """
26
+ https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md"""
29
27
30
28
# INTRO
31
29
@@ -130,8 +128,7 @@ The type of Constants must always be annotated.
130
128
131
129
Read more about constants and the differences between variables and constants
132
130
under 'Constants' in the book's section 'Variables and Mutability':
133
- https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#constants
134
- """
131
+ https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#constants"""
135
132
136
133
# FUNCTIONS
137
134
@@ -312,8 +309,7 @@ In Rust, there are two ways to define a Vector.
312
309
the initial values.
313
310
314
311
Check this chapter: https://doc.rust-lang.org/stable/book/ch08-01-vectors.html
315
- of the Rust book to learn more.
316
- """
312
+ of the Rust book to learn more."""
317
313
318
314
[[exercises ]]
319
315
name = " vecs2"
@@ -327,8 +323,7 @@ In the second function, we map the values of the input and collect them into a v
327
323
After you've completed both functions, decide for yourself which approach you
328
324
like better.
329
325
330
- What do you think is the more commonly used pattern under Rust developers?
331
- """
326
+ What do you think is the more commonly used pattern under Rust developers?"""
332
327
333
328
# MOVE SEMANTICS
334
329
@@ -355,8 +350,7 @@ We call this "moving" a variable. When we pass `vec0` into `fill_vec`, it's
355
350
being "moved" into `vec1`, meaning we can't access `vec0` anymore.
356
351
357
352
You could make another, separate version of the data that's in `vec0` and
358
- pass it to `fill_vec` instead.
359
- """
353
+ pass it to `fill_vec` instead."""
360
354
361
355
[[exercises ]]
362
356
name = " move_semantics3"
@@ -375,8 +369,7 @@ Carefully reason about the range in which each mutable reference is in
375
369
scope. Does it help to update the value of `x` immediately after
376
370
the mutable reference is taken?
377
371
Read more about 'Mutable References' in the book's section 'References and Borrowing':
378
- https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references.
379
- """
372
+ https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references."""
380
373
381
374
[[exercises ]]
382
375
name = " move_semantics5"
@@ -517,8 +510,7 @@ Example:
517
510
`placeholder("blue");`
518
511
should become
519
512
`string_slice("blue");`
520
- because "blue" is `&str`, not `String`.
521
- """
513
+ because "blue" is `&str`, not `String`."""
522
514
523
515
# MODULES
524
516
@@ -620,8 +612,7 @@ Remember that `Option`s can be nested in if-let and while-let statements.
620
612
621
613
For example: `if let Some(Some(x)) = y`
622
614
623
- Also see `Option::flatten`
624
- """
615
+ Also see `Option::flatten`"""
625
616
626
617
[[exercises ]]
627
618
name = " options3"
@@ -813,8 +804,7 @@ Here is how to specify a trait bound for an implementation block:
813
804
`impl<T: Trait1 + Trait2 + …> for Foo<T> { … }`
814
805
815
806
You may need this:
816
- `use std::fmt::Display;`
817
- """
807
+ `use std::fmt::Display;`"""
818
808
819
809
# LIFETIMES
820
810
0 commit comments