Skip to content

Commit bd7c659

Browse files
authored
Merge pull request #415 from coriolinus/simple-linked-list-fix-hints-md
simple-linked-list: fix hints.md
2 parents 70ecf1c + 2958fcd commit bd7c659

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

exercises/simple-linked-list/.meta/hints.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct Node<T> {
1717
```
1818
`data` contains the stored data, and `next` points to the following node (if available) or None.
1919

20-
### Why Option<__Box__<Node<T>>> and not just Option<Node<T>>?
20+
### Why `Option<Box<Node<T>>>` and not just `Option<Node<T>>`?
2121
Try it on your own. You will get the following error.
2222

2323
```
@@ -27,8 +27,7 @@ Try it on your own. You will get the following error.
2727
| next: Option<Node<T>>,
2828
| --------------------- recursive without indirection
2929
```
30-
30+
3131
The problem is that at compile time the size of next must be known.
3232
Since `next` is recursive ("a node has a node has a node..."), the compiler does not know how much memory is to be allocated.
3333
In contrast, [Box](https://doc.rust-lang.org/std/boxed/) is a heap pointer with a defined size.
34-

exercises/simple-linked-list/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct Node<T> {
4040
```
4141
`data` contains the stored data, and `next` points to the following node (if available) or None.
4242

43-
### Why Option<__Box__<Node<T>>> and not just Option<Node<T>>?
43+
### Why `Option<Box<Node<T>>>` and not just `Option<Node<T>>`?
4444
Try it on your own. You will get the following error.
4545

4646
```
@@ -50,11 +50,11 @@ Try it on your own. You will get the following error.
5050
| next: Option<Node<T>>,
5151
| --------------------- recursive without indirection
5252
```
53-
53+
5454
The problem is that at compile time the size of next must be known.
5555
Since `next` is recursive ("a node has a node has a node..."), the compiler does not know how much memory is to be allocated.
5656
In contrast, [Box](https://doc.rust-lang.org/std/boxed/) is a heap pointer with a defined size.
57-
57+
5858

5959
## Rust Installation
6060

0 commit comments

Comments
 (0)